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 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
why is the status Exited (-1) when docker stop some container
What benefits does Docker Compose have over Docker Swarm and Docker Stack?
Get YAML for deployed Kubernetes services?
Speed up Gitlab CI reusing docker machine for stages
Run Fluentd Docker Image as Non Root
Setup Docker Swarm [on hold]
Running commands in a Docker file
Output of `tail -f` at the end of a docker CMD is not showing
Docker in a Parallels' Virtual Windows 10 Pro Machine
multiple docker files in a directory

Categories

HOME
excel
neural-network
perl
.net-core
solr6
reverse-geocoding
local-storage
properties
modularity
windows-forms-designer
google-cloud-endpoints
quandl
vbulletin
ninja
sapply
trackjs
jxmaps
twincat-ads
sirikit
derivative
mitmproxy
jquery-animate
sitefinity
google-developers-console
endpoints-proto-datastore
http-caching
edi
bing-api
gtm-database
drools-fusion
aircrack-ng
uisegmentedcontrol
mpd
uppercase
gperftools
swiftmailer
powerdesigner
transitions
homescreen
sphero-api
3d-modelling
retrieve-and-rank
binary-image
imei
laravel-excel
grunt-string-replace
wso2-appm
dependency-properties
ucos
dispy
on-screen-keyboard
doubly-linked-list
xml-rpc
optional
canonical-link
gm
ilmerge
virtual-directory
numerical-analysis
unreal-blueprint
data-connections
spawn-fcgi
mediafire
tvml
gridster
youtube-javascript-api
singularitygs
jedit
mpld3
xcode-bots
github-linguist
unique-constraint
tap
geographical-information
apache-wink
wpftoolkit
jquery-dynatree
ews-managed-api
iec61131-3
vtune
arbitrary-precision
automapper-3
nools
bonsaijs
apparmor
factoring
maptiler
apiaxle
presentmodalviewcontrolle
nodejitsu
firepad
rdata
apprequests
slimv
scopes
function-overloading
dynamic-content
bionic
google-doodle
rakefile
clean-language
oracle8i
tibco-gi
microsoft.build
sqlmetal
pointer-arithmetic

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile