Helpful Docker Service Commands¶
WHAT TO EXPECT
In this section, users will find helpful Docker commands used during cloudSwXtch, swXtchBridge, and Licensing Server installations and upgrades.
List containers¶
docker ps
This command will list all the Docker containers currently running on your machine.
Example Output¶
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eb75bf825142 swx-swxtch:latest "./entrypoint.sh" 10 days ago Up 30 hours swx-swxtch
bd29e86862f0 registry:2 "/entrypoint.sh /etc…" 10 days ago Up 30 hours 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 5000/tcp registry
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.
Show logs¶
docker logs
This command will list the logs related to a container. For example, use the follow command and give the last 10 lines:
Example Output¶
$ docker logs swx-swxtch -f -n 10
swx-repl: USER1: RX: mempool_avail 223738
swx-repl: USER1: CTRL: mempool_avail 65531
info: launcher.go:39: swx-repl: USER1: TX: Total:258483929 Rate:16801-pps
swx-repl: USER1: RX: Load[21% 1%] Total:258497634 Rate:16800-pps
swx-repl: USER1: RX: mempool_avail 223708
swx-repl: USER1: CTRL: mempool_avail 65531
info: launcher.go:39: swx-repl: USER1: TX: Total:258567918 Rate:16796-pps
swx-repl: USER1: RX: Load[21% 1%] Total:258581681 Rate:16807-pps
swx-repl: USER1: RX: mempool_avail 223669
swx-repl: USER1: CTRL: mempool_avail 65531
PLEASE NOTE
There are other ways to check the logs. Please read the How to View cloudSwXtch and swXtchBridge Logs using shell page.
Stop a container¶
docker stop
This command stops a Docker container on the VM.
Example Output¶
Start a container¶
docker start
This command starts the Docker container on the VM.
Remove a container¶
docker remove
This command will remove the Docker container from the VM.
Example Output¶
PLEASE NOTE
Removing a container will not remove the image used to create it. Images are removed using docker rmi <image>