Docker Fundamentals - Getting Started

Starting a Shell


Starting a Shell

To execute a shell inside a container, run the command docker container run -it alpine sh. We will use the Alpine image, which is a minimal Docker image based on Alpine Linux. The -it flag tells Docker that you are running an interactive program. The sh command indicates that you are executing a command inside the container.

The command cat /etc/os-release allows you to check that you are actually inside an Alpine Linux.

The command uname -r provides info about the kernel.

To stop the shell press control + D.