Skip to content

Commit

Permalink
Merge pull request #48 from CiscoCloud/vibhi
Browse files Browse the repository at this point in the history
Vibhi
  • Loading branch information
agentlecisco committed Sep 15, 2020
2 parents 8113692 + 390cf81 commit 8b58ab6
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 21 deletions.
63 changes: 42 additions & 21 deletions labs/docker-101/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Objective

This Learning Lab introduces Docker, a tool suite for building, sharing and deploying __containers__. (For more information about containers, see the Containers-101 lab.) Use this learning lab to build, deploy and optionally share your first Docker container.
This Learning Lab introduces Docker, a tool suite for building, sharing, and deploying containers. For more information about containers, see the [Containers-101](https://developer.cisco.com/learning/lab/containers-101/step/1) Lab. Use this Learning Lab to build, deploy, and optionally share your first Docker container.

## For best results
This is a hands-on lab, but each example builds on the previous and explains *why* you run the commands. If you just skip to each command to run, without reading the text in between, you will not learn anything.
This is a hands-on Lab, but each example builds on the previous and explains why you run the commands. If you just skip to each command to run, without reading the text in between, you will not learn anything.

## Audience

Expand All @@ -16,58 +16,79 @@ This is a hands-on lab, but each example builds on the previous and explains *wh

## Content Notice

Thanks to the Cisco Live EU 2017 workshop "Introduction to Containers" for portions of this learning lab. Further reading is available in the excellent docker introduction at [imapex.io](https://github.com/imapex-training/mod_adv_docker/blob/master/README.md)
Thanks to the Cisco Live EU 2017 workshop "Introduction to Containers" for portions of this Learning Lab. Further reading is available in the excellent docker introduction at [imapex.io](https://github.com/imapex-training/mod_adv_docker/blob/master/README.md).

## Prerequisite

* Install Docker on your system.
* Create your Docker ID.
For more information about creating the Docker ID, see [Docker docs](https://docs.docker.com/docker-id/).

## Installing Docker
The Docker engine runs and manages containers on a host machine. The Docker client tools control the Docker engine. Both the Docker engine and the Docker client tools are now distributed by default as part of many Linux distributions. The engine and client tools are also available for download directly from [Docker.com](http://www.docker.com).

The __Docker engine__ runs and manages containers on a host machine. The __Docker client tools__ interact with and control the Docker engine. Both the Docker engine and the Docker client tools are
now distributed by default as part of many Linux distributions.
* To install and configure Docker on your Window system, see [Install Docker Desktop on Windows](https://docs.docker.com/docker-for-windows/install/).
* To install and configure Docker on your Mac system, see [Install Docker Desktop on Mac](https://docs.docker.com/docker-for-mac/install/).

The engine and client tools are also available for download directly from [Docker.com](http://www.docker.com).

## A Browser-Based Playground

For the hands-on sessions in this learning lab we'll use an in-browser Docker playground called [play-with-docker.com](http://labs.play-with-docker.com/).
For the hands-on sessions in this Learning Lab, we use an in-browser Docker playground called [play-with-docker.com](http://labs.play-with-docker.com/).

The play-with-docker.com site provides access to a full VM running Docker directly in a web browser, making it easy to work with Docker from any device.

1. Open [play-with-docker.com](http://labs.play-with-docker.com/) in a browser. The play-with-docker.com site displays a Captcha dialog to ensure that you're not a robot. Press __Play__ and complete the Captcha to continue to play-with-docker.com. The play-with-docker site displays a session countdown and an __Add New Instance__ button.
2. Click the __Add New Instance__ button. The play-with-docker.com site creates and displays a terminal session in the browser. The rest of this learning lab uses the in-browser terminal session to work with Docker.
1. Navigate to [play-with-docker.com](http://labs.play-with-docker.com/) in a browser.
The **Play with Docker** page is displayed.
2. In the **Play with Docker** page, choose **docker** from the **Login** drop-down list as shown below.

![Play With Docker Site](assets/images/playwithdocker1.png)
![](assets/images/login-docker.png)

The **Welcome Back** page is displayed.
3. In the **Welcome Back** page, enter the **Docker ID**, **Password**, and then click **Sign In**.

![](assets/images/login2.png)

The **Play with Docker** page is displayed.
4. In the **Play with Docker** page, click **Start** and continue to play-with-docker.com.

3. Confirm that Docker is available. The in-browser terminal session starts up with Docker already installed. To confirm that Docker is available, issue the following command at the prompt:
![](assets/images/start-docker.png)
5. Click **Add New Instance**.
The play-with-docker.com site creates and displays a terminal session in the browser. The rest of this Learning Lab uses the in-browser terminal session to work with Docker.
![Play With Docker Site](assets/images/playwithdocker1.png)
6. To confirm that the Docker is available, execute the following command at the prompt.
The in-browser terminal session starts up with Docker already installed.
```
docker -v
```
Output will look something like this:
Output will look similar to the following:
```
Docker version 1.13.1-rc1, build 2527cfc
```

# Getting and Running A Docker Container
# Getting and Running a Docker Container

The simplest way to use Docker is to run an existing public image that's available from [Docker Hub](https://hub.docker.com/).

Docker Hub is a public exchange for sharing Docker containers. Other Docker sharing sites are available, but we'll take advantage of the fact that Docker's command-line interface searches DockerHub by default.

To run a publicly-available Docker Container, follow these steps:

1. Search for a container named "hello-world." Use the command `docker search hello-world` to find the "hello-world"" image:
1. In the browser terminal, execute the following command to find the "hello-world" image:

`docker search hello-world`

![docker search hello-world](assets/images/dockersearch.png)
![docker search hello-world](assets/images/dockersearch.png)

Docker searches the public DockerHub repositories and finds the "hello-world" image.
You can see that Docker has found the "hello-world" image. Let's run it.

We can see that Docker has found the "hello-world" image. Let's run it.
2. Execute the following command to run the hello-world:

2. Run hello-world by executing this command:
```
docker run hello-world
```
`docker run hello-world`

![docker run hello-world](assets/images/dockerrun1.png)

Docker first checks to see whether the "hello-world" image is available locally. If not, Docker automatically downloads it from DockerHub. Docker sets up the container to run locally, including ensuring its isolation from other processes. Once the preparations are made, Docker runs the image.
Docker first checks to see whether the "hello-world" image is available locally. If not, Docker automatically downloads it from DockerHub. Docker sets up the container to run locally, ensuring its isolation from other processes. Once the preparations are made, Docker runs the image.

Congratulations! You just ran your first Docker container!

Expand Down
Binary file added labs/docker-101/assets/images/login-docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/docker-101/assets/images/login2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/docker-101/assets/images/start-docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8b58ab6

Please sign in to comment.