When activated by docker run
some docker container immediately start a software within. This can be useful for the author of the image, but for others it may cause issues.
Here is one example amongst many, from a series: Bioinformatics Docker Images Project which may be difficult for some users due to the use of ENTRYPOINT
within the docker file (the instructions to create a docker image):
pegi3s/clustalomega
If take a peek at the docker file you will see that the last line says:
ENTRYPOINT ["clustalo"]
This means that when the docker image is activated the program clustalo
will be started which may cause the docker container to immediately shut down if you can’t provide appropriate files.
The remedy is to provide an alternate entry point at start-up. For example:
docker run -it --rm --entrypoint "/bin/bash" pegi3s/clustalomega
this will start the container as an interactive terminal (-it
) that will be automatically removed when the container is exiting (--rm
) and provides an alternate entry point that will start a bash
shell. After this command the user will be looking within the container and will be able to manually start the clustalo
program.
See also these blogs:
- How to properly override the ENTRYPOINT using docker run (archived 11NOV 2019: bit.ly/2QFlGne)
- Docker RUN vs CMD vs ENTRYPOINT (archived 25MAR 2019: bit.ly/35pg8Bj )