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

Categories

HOME
linux-kernel
perl
datastax
form-submit
soap
https
mongoose
winzip
entities
authorization
javafx-2
bootstrap-datepicker
keyboard-shortcuts
import
google-home
unity5
linuxmint
datagrid
fluent-assertions
business-objects
sensenet
bit-manipulation
image-comparison
jquery-animate
ssrs-2016
boto
gembox-document
robotium-recorder
ext4
bing-api
podcast
multiple-domains
infowindow
radio
ecore
appery.io
sharethis
free-jqgrid
gooddata
mlt
protactor
ssas-tabular
carplay
enterprise-library-6
ifttt
exports-loader
preferencefragment
orika
case-class
opensmtpd
jquery-ui-tabs
bisonc++
on-screen-keyboard
collaborative-filtering
rpy2
google-chrome-arc
outlook-2016
local-variables
dbx
strstream
mechanize
dart-polymer
kmip
page-load-time
nsolid
iis-8.5
stl-format
struts2-jquery-grid
7digital
gstat
unexpectendoffile
dynamic-ip
soundex
ontouchevent
lastaccesstime
kiosk-mode
uploadifive
ews-managed-api
sqloledb
facade
stop-words
openacs
ios-provisioning
controltemplate
webproxy
yepnope
scite
node-http-proxy
jbossws
aspnet-regiis.exe
jsonexception
pull-to-refresh
emacs-dirtree
fatwire
phonetics
keymando
incompatibletypeerror
primefaces-extensions
viewstack
glossary
tomahawk
ant4eclipse
context-sensitive-help
oracle8i
incremental-linking
live-cd
tibco-gi
html-rendering
visual-programming
testing-strategies

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile