Reputation: 7652
I am trying to run Redmin
via docker
.
Here is what I am going to do
redmine:latest
docker image to custom imageSo I made Dockerfile
like
FROM redmine
CMD ["echo", "Redmine is ready!"]
Then I built image with docker build -t test .
.(In the Dockerfile
folder)
After that, docker run -d --name=test -p 8080:3000 test
.
I expected can find test
docker container is run
state, but it is exit(0)
.
How can I make this container keep alive?
FYI, docker run -d --name=test -p 8080:3000 redmine
works fine.
Upvotes: 0
Views: 304
Reputation: 2685
Within your docker image CMD can be used only once. If you have more than one, only the last one will run.
You will need to add the
CMD ["rails", "server", "-b", "0.0.0.0"]
As the cmd for your custom image to run the server. At the moment your CMD only executes echo as soon as that command is executed your container will exit.
Upvotes: 1