Helpful Docker Service Commands

Prev Next

WHAT TO EXPECT

In this section, users will find helpful docker service commands used during cloudSwXtch Bridge and Licensing Server installations and upgrades.

docker ps

This command will list all the docker containers currently running on your machine.

docker ps

Example Output:

ubuntu@ip-10-64-29-105:~$ docker ps
CONTAINER ID   IMAGE                                        COMMAND                  CREATED          STATUS          PORTS                                       NAMES
4a6499471644   ghcr.io/swxtchio/swx-license-server:latest   "/swxtch/swxtch-lice…"   11 minutes ago   Up 11 minutes   0.0.0.0:8081->8081/tcp, :::8081->8081/tcp   swx-license-server

Container ID

Using docker ps will list all the container IDs found on your machine. You will use these for other commands in this article.

docker logs

This command will list the logs related to a container.

docker logs <Container-ID> -f

Example:

ubuntu@ip-10-64-29-105:~$ docker logs 4a6499471644 -f

docker stop

This command stops the docker service on your machine.

docker stop <Container-ID>

Example:

ubuntu@ip-10-64-29-105:~$ docker stop 4a6499471644
4a6499471644

WARNING

If you plan on restarting the same container, it is important that you record the Container ID. A stopped container will not appear when you do a docker ps.

docker start

This command starts the docker service on your machine.

ubuntu@ip-10-64-29-105:~$ docker start <Container-ID>

Example:

ubuntu@ip-10-64-29-105:~$ docker start 4a6499471644
4a6499471644

Example Output:

docker remove

This command will remove the docker service from your machine.

ubuntu@ip-10-64-29-105:~$ docker rm <Container-ID>

Example:

ubuntu@ip-10-64-29-105:~$ docker rm 4a6499471644
4a6499471644