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

Setting up dnsmasq docker container for dns-caching
Using loop devices in docker without --privileged flag
How to config Marathon-lb to load balance a service launched in HOST network?
Gitlab CI runner not able to expose ports of nested Docker containers
ZMQ crashes “randomly” in aiohttp web service
Can you have a docker copy in the same line as docker run
docker private registry within local network
Connecting php docker to mqtt docker
docker build Error checking context: 'can't stat '\\?\C:\Users\username\AppData\Local\Application Data''
Slowness in Docker container
What is image sprawl in docker and how to avoid it?
Many Docker Containers and Thrift
Docker containers in different directories under one daemon
Pod creation in ContainerCreating state always
Test docker containers using travis-ci
what is the use of HOST and NONE network in docker?

Categories

HOME
cordova
phpunit
lucene
sails.js
dropbox-api
unix
asp-classic
set
sharppcap
luigi
uwp-xaml
64bit
mutex
android-animation
formula
ios8
purescript
osticket
spark-dataframe
directive
treeset
log4net
sql-azure
hudson
dht
skybot
markup
sprite
google-app-invites
miktex
uiinterfaceorientation
actionlink
android-appbarlayout
git-clone
remote-connections
measurement
na
modeling
get-eventlog
tornado-motor
hashcode
lightgallery
gunicorn
dos
google-tv
web.py
transitions
envelope
angular2-http
shieldui
gulp-usemin
khan-academy
imei
cartography
getelementsbyclassname
evosuite
implicit
slug
cscore
htsql
ucp
client-side
user-mode-linux
data-connections
mediafire
sonarqube-5.4
traceroute
stunnel
execution-time
realbasic
angular-ui-tree
tstringgrid
acl2
fluid-layout
protection
order-of-operations
drilldown
soundex
.a
determinants
openni
rot13
iec61131-3
javascript-databinding
kendo-validator
factoring
avassetwriter
countries
yepnope
c++builder-6
stackmob
ruby-on-rails-plugins
cgimagesource
badimageformatexception
circusd
dotfuscator
springmockito
happstack
struts-config
nexus-7
testdriven.net
hibernate-annotations
visualtreehelper
silverlight-embedded
cocos2d-python
white-box-testing

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile