Does someone know how to start and stop services inside the container?
E.g. wish to stop sshd service INSIDE the Ubuntu container, but not in the whole host (RHEL).
Does someone know how to start and stop services inside the container?
E.g. wish to stop sshd service INSIDE the Ubuntu container, but not in the whole host (RHEL).
you need to get a root shell in the container with docker exec -it <container_name> /bin/bash
then you can run the command that you want
Log in to the container using the below command
docker exec -it <container_id> /bin/bash
Using any of the below commands can stop the ssh service
$ sudo /etc/init.d/ssh stop
or $ sudo service ssh stop
or $ sudo systemctl stop ssh