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

Bluemix Docker container cf ic run doesn't seem to accept -p sub-command
Unable to push image to a docker registry configured as proxy cache
docker: connect to database container via dockerhost
Tsung: client connection using port
Detach Docker Container Automatically
docker-machine osx port forwarding
Image deployment with config files
Shared folder in Docker. With Windows. Not only “C/user/” path
Deploying docker swarm without using docker machine
Why does Yesod's TestImport module ignoreEnv in loadAppSettings?
Bind-mount volume of different type from guest to host
Responses from kubernetes containers getting lost
Docker plugin : java.io.FileNotFoundException: /src/main/docker/Dockerfile gradle-docker fails
how to create images interactive from Dockerfile? [duplicate]
Docker: Find dockerfile of images
ordered build of nested docker images with compose

Categories

HOME
machine-learning
datatables
firebase-authentication
netlogo
basecamp
ibm-mobilefirst
conditional
google-places-api
netfilter
android-toast
shoutem
sourceforge
smt
pentaho-spoon
skybot
eventtrigger
google-nativeclient
google-developers-console
ssis-2008
measurement
android-sensors
hp-quality-center
sublimerepl
required
tornado-motor
tail-recursion
basic4android
each
xfs
fitnesse-slim
smartassembly
grayscale
actor
oracle-sql-data-modeler
binary-image
libphonenumber
html.dropdownlistfor
ole
inputstreamreader
allegro5
generated
django-compressor
db-schema
magicalrecord
outlook-2016
canonical-link
cscore
gio
video-recording
nested-forms
powergrep
datepart
django-class-based-views
user-mode-linux
firefox-addon-bootstrap
polymer-designer-tool
8085
assignment-operator
pysqlite
xamarin-forms
event-loop
visual-studio-2010-sp1
topological-sort
jxa
wpftoolkit
file-attributes
apache-tomee
automapper-3
jekyll-extensions
deface
runscope
webproxy
linq-to-lucene
alassetslibrary
android-3.0-honeycomb
websitespark
pull-to-refresh
wexitstatus
icarousel
memory-profiling
testdriven.net
dynamic-content
wcsf
juggernaut
bootclasspath
release-builds

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App