Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 1.75 KB

06_named_containers.md

File metadata and controls

73 lines (48 loc) · 1.75 KB

Named Containers

Docker Documenation References:

docker create

docker pull

docker ps

Intent

The purpose of this kata is to familarize yourself with the process of creating a container with a specific name.

Overview

In this exercise we will pull and image and create a container with a specific name using that image.

Kata Steps

Pull a simple image, nginx:alpine

Command

docker pull nginx:alpine

Output

thought:DockerKata rich$ docker pull nginx:alpine
alpine: Pulling from library/nginx
cfc728c1c558: Pull complete
59e0e447b6ec: Pull complete
1c89b5c5bd38: Pull complete
584d454ad7fd: Pull complete
Digest: sha256:33eb1ed1e802d4f71e52421f56af028cdf12bb3bfff5affeaf5bf0e328ffa1bc
Status: Downloaded newer image for nginx:alpine

Create Named Container

Command

docker create --name docker_katas_nginx -p 80:80 nginx:alpine

Output

thought:DockerKata rich$ docker create --name docker_katas_nginx -p 80:80 nginx:alpine
52450ca5b4a9926bb18594fac1c6677fe50c99af995d9720ace45b81dd88bc0e

List All Containers

Command

docker ps -a

Output

thought:DockerKata rich$ docker ps -a
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS                     PORTS               NAMES
52450ca5b4a9        nginx:alpine                   "nginx -g 'daemon ..."   37 seconds ago      Created                                        docker_katas_nginx

Previous | Index | Next