sudo docker pull busybox
Pull the Busybox repository from Docker registry to our local system.
sudo docker images
List all images saved on the local system.
sudo docker run busybox
You may find that nothing happens after sending the command.
What is going on?
Well… the busybox container has actually been started, and commands are run inside the container.
But we did not issue a command to the container, so it exited.
sudo docker ps -a
Show your containers currently running, append "-a" to list all containers.
You can found the status of container - "Exited".
sudo docker run busybox echo "2021/08/09"
Here we give the busybox container the command "echo".
As expected, we will get the output.
Because the above experiments are all one-offs, what if we want to interact with the container?
sudo docker run -it busybox sh
Now, you can do lots of things within this container.
[P.s] This container is just a busybox, so its environment cannot do any complicated applications. We will talk more about how to build applications using Linux mirroring.
@ docker for devops series - 1
CY