User Tools

Site Tools


apps:manage_docker

Docker container management

Description

This tutorial shows how to manage Docker containers.
In these examples, please replace the string <service> with the service name, and <container_folder> with the container folder (check on the wiki server page).

Enable/disable the service

Enable the containers

If you want to use the containers, you need to activate them. Once they are not activated we cannot stop or start them. For that, type

 $ sudo systemctl enable <service>

The enabled state ensure that the containers will be started on a server boot.

Disable the containers

 $ sudo systemctl disable <service>

Start/stop the service

Check the containers

In order to know if the containers are running on the server, we need to check with:

 $ sudo systemctl status <service>

Start the containers

Normally, the containers are active, even after a reboot. But if that is not the case we can start them by:

 $ sudo systemctl start <service>

Stop the containers

If we need to stop them:

 $ sudo systemctl stop <service>

Note:

We can combine the stop, then a start with:

 $ sudo systemctl restart <service>

Build the containers

After a modification in the configuration, we need to re-build the containers.

 $ cd <container_folder>
 $ sudo docker-compose up --build

Once the containers are running, stop them with a ctrl c or

 $ sudo systemctl stop <service>

or, if you want use the containers after the stop:

 $ sudo systemctl restart <service>

Note:

At the first use, if not yet built, the start command will build the containers.

apps/manage_docker.txt · Last modified: 2019/07/11 09:44 by 192.168.2.236