ActiveState / dockron

Schedule your 'docker run's without having to install cron on the host
https://registry.hub.docker.com/u/activestate/dockron/
MIT License
29 stars 9 forks source link

Can't start container following README #2

Closed michaellopez closed 8 years ago

michaellopez commented 8 years ago

I am following the README, am I missing something?

$ docker pull activestate/dockron
Using default tag: latest
latest: Pulling from activestate/dockron

Digest: sha256:b382ca64ac55a196d625469bbb3d66a25a67cf5827c50016ea5777a2259c604c
Status: Image is up to date for activestate/dockron:latest
$ alias dockron="docker run --rm \
       -v $(which docker):/usr/bin/docker:ro \
       -v /var/run/docker.sock:/var/run/docker.sock \
       activestate/dockron"
$ alias
...
alias dockron='docker run --rm        -v /usr/local/bin/docker:/usr/bin/docker:ro        -v /var/run/docker.sock:/var/run/docker.sock        activestate/dockron'
...
$ dockron "0 * * * *" docker run ubuntu /bin/bash -c "echo Hello world"
exec: "/go/src/app/app": stat /go/src/app/app: no such file or directory
Error response from daemon: Cannot start container 4dd6c3ab2beed26296549eb19a00f731a3a55aa977e78d1a0ff4119802b5b740: [8] System error: exec: "/go/src/app/app": stat /go/src/app/app: no such file or directory

Looking at the Dockerfile and Makefile I'm not seeing how dockron.go is ever executed/run? Does golang:1.3.1-onbuild do something special?

michaellopez commented 8 years ago

I'm not sure why ENTRYPOINT ["/go/src/app/app"] is in the Dockerfile?

ihcsim commented 8 years ago

@michaellopez The golang:1.3.1-onbuild image has some ONBUILD triggers which copy the content of this project folder into the container /go/src/app folder, follow by a call to go install -v. The app binary is then installed in $GOPATH/bin. (You can read more about this on the Golang official Docker Hub repo.)

Meanwhile, you can get this to work by replacing ENTRYPOINT ["/go/src/app/app"] with ENTRYPOINT ["/go/bin/app"]. I will open a PR to fix this.

michaellopez commented 8 years ago

@ihcsim Thanks for the info. I did a fork of this repo (https://github.com/weahead/dockron) where I updated the image and changed the Dockerfile to not use onbuild given the recommendations in golangs docker hub repo

But I'll see if your PR fixes my issue then I'll be glad to drop my fork as it would no longer be needed.

michaellopez commented 8 years ago

@ihcsim When do you think this PR will get merged and pushed to Docker hub?

ihcsim commented 8 years ago

@michaellopez The PR is merged. I have also updated the Dockerfile to use golang-1.5.2-onbuild as its base image, since 1.3 has been removed.

Let me know if this works.

michaellopez commented 8 years ago

@ihcsim Works perfect now. Dropped my fork, not needed now. Thanks for your effort!