docker
docker run does not work from cronjob
I got a cronjob set up on an AWS EC2 instance which is supposed to start a docker container: 15 0 * * * docker run -e ENVIRONMENT=dev myrepo/my-image-name I can see in the cron log it's attempting to run the job, but the container does not get run. Tried with sudo, still does not run. What could be reason for that?
cron does not know about environment variables, e.g. $PATH - so it cannot find docker to run. Should specify full path: /usr/bin/docker, like this: 15 0 * * * /usr/bin/docker run -e ENVIRONMENT=dev myrepo/my-image-name To those who wonder how to find where the docker lives: run which docker in your console.
Related Links
Docker command to remove all the containers and their images except the ones with a particular label
Understanding kubernetes deployment, service, and docker image ports
Cleaning half-downloaded docker image
How to delete a docker image in dockerhub with a particular tag or set of tags using CLI?
list of premade docker-compose.yml configurations
How do I use docker on Win 8.1 (boot2docker) both behind a proxy and without a proxy?
Is LXD is used in production?
How to run a command after creating a container using yml file
Getting All Docker Container's IP Address along with Container ID's and Name's
JGroups doesnt form a cluster while running inside docker across multiple nodes
docker run complains file not found
Keep docker-compose container running after ENTRYPOINT
Docker: access to VPN domain from docker
Where to find more explicit errors given container error status codes?
Get host name/ip for Docker network
EOF Alternative for calling ArangoDB query on Octave