Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 1.68 KB

01_pull_and_run_image.md

File metadata and controls

75 lines (46 loc) · 1.68 KB

Pull and Run an Image

Docker Documentation References:

docker pull

docker run

Intent

The purpose of this kata is to familarize yourself with the process of pulling an image from a repository and running it.

Overview

In this exercise we will pull an image for the NGINX Web Server and run it using only defaults. Later we will use this image to demostrate other features of docker.

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

Run the nginx image

Command

docker run -p 80:80 nginx:alpine

Output

thought:DockerKata rich$ docker run -p 80:80 nginx:alpine

Test the running container

Command (in another terminal):

open http://localhost:8080

Or click here

Note: This works because your meta-docker container has exposed port 80 on localhost port 8080. If you are executing this kata outside of the meta-docker contianer use port 80 only.

Output

NGINX Screen Shot

Stop the running container

Use Ctrl-C on the command line where you executed

Previous | Index | Next