Open the-hotmann opened 2 years ago
Found a workaround, so the container stays active and idles so you always have a ready container which you can access with:
docker exec -it tools /bin/bash
The workaround is, using the -d
(detatched) parameter to start it, like this:
docker run --name tools -d -it cmd.cat/curl/wget
That gives the container the name tools
and starts him in the background, so he does not terminate if you are not active in his terminal.
Sadly this is not a docker-compose
way, but the old traditional docker
way of starting things. Would be thankful for any hint how to do it with docker-compose
, tried it already but nothing worked.
The container has to be interactive
, so -it
has to be used when running docker run
, same for docker-compose. The default command is always shell, so no need to change this one.
I tried to set up a little tool-container with tools from cmd.cat to not having to install them on my host machine. But since I want to install and update them with docker-compose and keep the container running I set up my docker-compose file like this:
the command:
docker-compose pull tools && docker-compose up -d
runs through smooth, but then the container keeps on restarting and ends up in a restart loop:Is there any good way, to run these cmd.cat tools in a persistent container so I don't have to start them with
docker run -it
everytime I want to use them? Thanks in advance!