startup - Docker Container Failing To Start On Boot -
I am running an EC2 instance with a startup script which is called on the reboot. This startup script checks that the Docker Daemon is running before the container starts, but fails with error: post http: ///var/run/docker.sock/v1.13/containers/create : Dial Unix / Var / run / docker.sock: Any such file or directory
startup script
# That the Docker Daemon started sudo / usr / sbin / service start doc #container sudo / usr / bin / dokter run start -d 91b5261e2dc0
Please note that one of your EC2 examples The testing, where "sudo" does not require password entry.
Crownbat entry:
@reboot / bin / bash /home/ubuntu/start-container.sh 2> /home/ubuntu/cron_errors.log
Errors:
Start: Job is already running: Docker 2014 / 08/01 09:45:48 Post http: ///var/run/docker.sock/v1.13/containers/create: Dial Unix /var/run/docker.sock: Any such file or directory
Whenever I run the startup script manually, it works perfectly, which seems like an environment variable / path problem for me DOCKER_HOST not found information about setting Googling around, but DOCKER _HOST is still not set, even though the startup script works fine.
What do I need to change or define to start correctly on container startup
version information / P>
OS: Ubuntu 14.04 Hardware Virtualized. Customer's version: 1.1.2 Client API version: 1.13 Go version (client): go1.2.1 GET Commit (customer): d84a070 Server version:
1.1.2 Server API version: 1.13 Go version (server): go1.12.1 Geomet cite (server): d84a070
uname -a output
Linux IP-10-76-167-92 3.13.0-32- Genetic # 57-Ubuntu SMP Tuesday July 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU / Linux
"Solution" to start the Docker Daemon Put in a word or ended to wait after the call. For example, start the Doctor daemon sudo / usr / sbin / service doc to wait for the start of the sleep start 10 # container sudo / usr / bin / docher daemon starting # wait, for example
Make Run-D 91b5261e2dc0
It appears because Chris MacKinnell had said:
... if you have / etc / init Have a look at .d / docker, you will see that at the beginning of the calling - background option is used for start-stop-daemon Land, meaning that he still does stuff.
& amp; & Amp; ?
After calling for the start of the Docker Daemon, call & amp; Amp; & Amp; Amp; Amp; Amp; & Amp; Amp; Amp; & Amp; Amp; & Amp; & Amp; & Amp; & Amp; & Amp;
will run the next command if the first was successful that is not always the case (for example if the Docker Daemon is already running). []
Comments
Post a Comment