Skip to content

No exit option on the docker image to prevent the container from exiting #171

Answered by pkosiec
m3h0w asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @m3h0w,
You don't need to modify the image. You can easily change the entrypoint and command via Docker Compose file:

So, you can try using the same commands you had in the entry.sh script:

mongo-seed:
  # (...)
  entrypoint: ["sh"]
  command: ["-c", "seed; sleep infinity"]

I didn't test it with Docker Compose, but it should work, as the following Docker command works exactly as you would like to:

docker run --rm --entrypoint="sh" pkosiec/mongo-seeding -c 'seed; sleep infinity'

Let me know if that helps. Cheers!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@iampeterbanjo
Comment options

@pkosiec
Comment options

@iampeterbanjo
Comment options

Answer selected by m3h0w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area/docker-image Refers to Mongo Seeding Docker Image
3 participants
Converted from issue

This discussion was converted from issue #170 on May 24, 2021 22:19.