This post tells how Docker uses network namespace to isolate resources. The following figure is the lab setup to help you understand the steps visually: 1. Create two network namespaces: ns1 and ns2. – Add two new naetwork namespaces: # ip netns add ns1 # ip netns add ns2 The above commands create network space […]
Archives for December 2019
“su: Authentication failure” – in Docker
The Problem In some situations, a normal user within a Docker container cannot run ‘su’ command to switch user. When ‘su’ command is issued, the following error returns. $ su – Password: [entering correct password] su: Authentication failure The Solution The sticky permission may be missing in /usr/bin/su within the container. With root privilege, you […]
How to Pause and Resume Docker Containers
Question: How to Pause and Resume running containers on docker host? This post will help to know about pausing and resuming any running containers on the Docker host. Let’s first start the docker container “memory_test” on the docker host. # docker start memory_test memory_test To stop the pause the docker container: # docker pause memory_test […]
How to find docker storage device and its size (device mapper storage driver)
Question: How to find the running docker storage device when docker is using the device-mapper storage driver and then check the size of it? 1. Please run the “docker info” command to display docker system-wide information which contains the docker storage info. # docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 […]
Understanding “docker stats” Command Output
Question: How to monitor a running docker container performance metrics. For example, CPU,memory, I/O and network stats? The docker stats command can continuously report the basic CPU, memory, network and disk I/O metrics. For example: # docker stats a3f78cb32a8e CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS […]
Docker Basics – Expose ports, port binding and docker link
This post illustrates three methods to link Docker containers. Expose ports and port binding Expose ports This method is used for within the same network or the docker host. Containers on the same network can talk to each other over their exposed ports and you can expose the ports by one of the below methods. […]