New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple commands in entrypoint #52

imaia opened this Issue Dec 27, 2016 · 4 comments


None yet
4 participants

imaia commented Dec 27, 2016

I'm trying to copy some files before running my entrypoint script. I tried something like this in my docker-compose.yml:

entrypoint: ["sh", "-c", "cp -r /usr/src/redmine/public/. /www/public/ && /"]

But I'm getting a exit code 0. Suggestions?


This comment has been minimized.

abcfy2 commented Dec 28, 2016

You don't need to modify entrypoint, just set command.

      - /bin/sh
      - -c
      - |
          bundle config mirror.
          bundle exec rake redmine:plugins:migrate RAILS_ENV=production
          bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
          / passenger start

YAML supports multiline string.


This comment has been minimized.

jadekler commented Aug 18, 2017

Awesome solution @abcfy2

imacks added a commit to dockerguys/ranchcat that referenced this issue Apr 5, 2018

docker-registry image
proper way to implement multiline commands with docker-compose, tks to docker-library/redmine#52

This comment has been minimized.


tianon commented Apr 24, 2018

Closing, given the excellent solution posted above. 👍

(The only change I'd personally make is adding exec before the invocation of / to ensure the outer shell process gets ditched and Redmine properly becomes PID 1.)

@tianon tianon closed this Apr 24, 2018


This comment has been minimized.

abcfy2 commented Apr 25, 2018

No problem. Because the last line of / is exec "$@", so this script will ensure Redmine become PID 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment