I am new to docker, and have been playing with the docker image in hub.docker.com
I want to add ssh service to the container. I could apt-get install
the package (after apt-get update
), but I don't know how to start it.
Normally (not in this container), we could start the service via a regular command of service ssh start
. But I don't know how to do this in the container without out interfering with the ENTRYPOINT
and CMD
mechanisms.
The dockerfile comes with a docker-entrypoint.sh
(see source code here) that pretty much expects to have a line for CMD
CMD ["mysqld"]
I have read some related SO articles, such as these:
- How to automatically start a service when running a docker container?
- Start sshd automatically with docker container
but they are not directly applicable here due to the interplay of ENTRYPOINT
and CMD
in the docker file.