Skip to content

Commit

Permalink
Merge pull request #39 from CiscoCloud/json-fixes
Browse files Browse the repository at this point in the history
Ensure sidebar table of contents has titles
  • Loading branch information
annegentle committed Jan 23, 2019
2 parents e8c4c1a + 61e43b6 commit 0dcac07
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 91 deletions.
10 changes: 5 additions & 5 deletions labs/CiscoContainerPlatform-101/1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cisco Container Platform 101
# Cisco Container Platform Introduction

## Objectives

Expand Down Expand Up @@ -50,11 +50,11 @@ HyperFlex storage is also resilient across the servers in the HyperFlex pool, al

Let's dig in!

# Step 0 - Access the Cisco Container Platform sandbox!
## First - Access the Cisco Container Platform sandbox!

Firstly, we'll need a Cisco Container Platform environment, luckily we have plenty of these in the DEVNET sandbox, allowing you to reserve access to a CCP environment for up to 7 days, more than enough time to explore!

### Step 1: Reserve a Cisco Container Platform sandbox.
### Reserve a Cisco Container Platform sandbox.
For this we will use the "Cisco Container Platform DEVNET Sandbox", this environment will provide access to a pre-installed Cisco Container Platform cluster, serving as our "On premise" setup for this Lab.

Go to [https://devnetsandbox.cisco.com](https://devnetsandbox.cisco.com/RM/Diagram/Index/6f419def-1813-481f-a6c6-a469993d4bb0?diagramType=Topology), login and reserve the "Cisco Container Platform v2.2.2" sandbox for 2 hours.
Expand All @@ -67,7 +67,7 @@ Click `RESERVE`

Click `RESERVE` once more.

### Step 2 - Access Cisco Container Platform.
### Access Cisco Container Platform.
The Sandbox environment will take ~8 mins to spin up, it creates a fresh installation of Cisco Container Platform for each user and will email you VPN credentials when ready. Using the VPN lets us remotely access a private on-premise lab environment.

The E-Mail also contains instructions for installing the AnyConnect VPN client if you do not already have it; however the classroom workstations already have this installed.
Expand Down Expand Up @@ -111,7 +111,7 @@ As you can see, we're directly into a vanilla Kubernetes cluster, we'll see how

![](assets/images/initial-k8s-dash.png)

## C. Cisco Container Platform permissions.
## C. Cisco Container Platform permissions

There are two types of access currently implemented in Cisco Container Platform, `admin` users can create and view all clusters, and `user` users that can only see the clusters they have been assigned; your sandbox has provided you an 'admin' user, so you are able to create clusters and see the existing `Sandbox-Demo-Cluster-1`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"labId": "CiscoContainerPlatform-101",
"title": "A Hands on introduction to the Cisco Container Platform v2.2.2",
"slug": "UPDATED to CCP v2.2.2! automatically provision and use Kubernetes clusters with Cisco Container Platform",
"title": "A hands-on introduction to the Cisco Container Platform v2.2.2",
"slug": "UPDATED to CCP v2.2.2! Automatically provision and use Kubernetes clusters with Cisco Container Platform.",
"time": "30",
"tags": [{
"title": "Kubernetes"
Expand All @@ -22,7 +22,7 @@
"title": "Step 3: API Cluster Creation",
"file": "3.md"
}, {
"title": "Testing our deployed Owncloud App!",
"title": "Step 4: Testing our deployed Owncloud App!",
"file": "4.md"
}],
"related": [{
Expand Down
2 changes: 1 addition & 1 deletion labs/CiscoContainerPlatform-101/byod.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<p>All the exercises in the Cisco Container Platform 101 Learning Lab can be completed using <a href="https://devnetsandbox.cisco.com/RM/Diagram/Index/6f419def-1813-481f-a6c6-a469993d4bb0?diagramType=Topology" target="_blank">DevNet Cisco Container Platform Sandbox</a>.</p>
<p>All the exercises in the Cisco Container Platform Introduction Learning Lab can be completed using <a href="https://devnetsandbox.cisco.com/RM/Diagram/Index/6f419def-1813-481f-a6c6-a469993d4bb0?diagramType=Topology" target="_blank">DevNet Cisco Container Platform Sandbox</a>.</p>
</div>
2 changes: 1 addition & 1 deletion labs/cicd-intro/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Objective

This learning lab will introduce you to Continuous Integration (CI) and Continuous Deployment (CD) techniques and principals designed to automate the workflow of a modern app developer.
This Learning Lab will introduce you to Continuous Integration (CI) and Continuous Deployment (CD) techniques and principals designed to automate the workflow of a modern app developer.

Following on from the other 101 series Microservices track, we build on Docker-101, a basic understanding of using Docker to package your applications will be beneficial.

Expand Down
10 changes: 5 additions & 5 deletions labs/containers-101/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This learning lab provides background on "Containers": what they are, what they
* System Architects and Engineers
* IT teams addressing the developer need for Docker and Containers

## What are Containers?
## What are containers?

In the simplest sense, containers are just a way of isolating running processes or code without using what we know as virtual machines (VMs) or full virtualisation. Containers allow developers to build, package, share, and deploy applications.
In the simplest sense, containers are just a way of isolating running processes or code without using what we know as virtual machines (VMs) or full virtualisation. Containers allow developers to build, package, share, and deploy applications.

Containers provide a way to:
* Package applications and dependencies.
Expand All @@ -35,20 +35,20 @@ Both Windows and macOS have similar isolation features for containerizing apps a

It's important to note is that there is only one kernel, with possibly many containers, all running on one operating system that manages the isolation of the containers. In contrast, virtualization requires installing a whole operating system for each virtual machine.

## What's Changed? Why are Containers so Important Now?
## What has changed? Why are containers so important now?

Developers (or the Operations teams they relied upon) used to have to care deeply about all of the above if they wanted to use containers; for example, they needed to know the ins and outs of CGroups. Then, once they worked out how to isolate their app, they still need a way of actually installing that "container" onto their system, then running it, updating it, and so on ... the usual software deployment lifecycle.

Simply put, containers of the past were a technology, not a polished product. For most, the barrier to entry was too high, and the advantages were too unclear.

## What Containers ARE NO
## What Containers ARE NOT

* **Microservices**: Containers are often confused with __microservices__. Microservices are lightweight system services, which can benefit from the low overhead provided by containers, especially when splitting up multiple tasks that would previously have been handled within an older, more complex application, but they are not the *same thing* as containers. Any application can be packaged using containers; it doesn't have to be a microservice. Even a badly-written legacy application can be packaged in a container. Using a container doesn't magically improve an application.
* **Virtual Machines**: Containers are not VMs. Containers run entirely in user space. If an application requires kernel extensions, kernel modules, or a custom kernel then a container is probably not the right solution
for it.
* **Magic**: A container is a tool like other tools. It has its own limitations and nuances and its own deployment considerations, just like any other tool.

### Containers Today: a Cast of Supporting Players
### Containers today: a cast of supporting players

Today, the word "Containers" is as much about the tools that have grown *around* these technologies as it is about containerization technologies themselves. There is increased focus on user experience, reducing the investment of "time to get stuff done" by developers and Operations staff. Current tools have made the deployment lifecycle a lot easier.

Expand Down
10 changes: 6 additions & 4 deletions labs/containers-101/containers-101.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
"title": "Beginner"
}],
"files": [{
"title": "1.md"
"title": "Introducing containers",
"file": "1.md"
}, {
"title": "2.md"
"title": "Benefits of containers",
"file": "2.md"
}],
"related": [{
"labId": "docker-101",
Expand All @@ -22,8 +24,8 @@
"labId": "microservices-overview",
"title": "Containers are not Microservices, but they do go hand in hand! Learn more here."
}, {
"labId": "kubernetes-101",
"title": "Kubernetes: Deploying docker containers into a Kubernetes cluster."
"labId": "CiscoContainerPlatform-101",
"title": "Automatically provision and use Kubernetes clusters with Cisco Container Platform."
}],
"authors": [{
"name": "Matt Johnson",
Expand Down
7 changes: 3 additions & 4 deletions labs/docker-101/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 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 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.
Expand Down Expand Up @@ -54,7 +54,7 @@ Docker Hub is a public exchange for sharing Docker containers. Other Docker shar
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:

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

Docker searches the public DockerHub repositories and finds the "hello-world" image.
Expand All @@ -66,10 +66,9 @@ To run a publicly-available Docker Container, follow these steps:
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.

Congratulations! You just ran your first Docker container!

The following sections explain what happened behind the scenes, and how to create your own Docker images.

10 changes: 5 additions & 5 deletions labs/docker-101/2.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Creating a Docker image
# Get or create a Docker image

How did the author of "hello-world" create the container image? Because it's available on the public DockerHub repository, we can find out by inspecting the files.

Expand Down Expand Up @@ -54,7 +54,7 @@ When an application runs from a Docker container, it's completely isolated from

In the "hello-world" example the only resource that the image needs is the compiled binary `hello`. The Dockerfile mentions no other resources because none are needed for it to run.

What if you want to create a container that runs a more complicated napplication? What if, for example, you want to build a container that runs the NGINX webserver? NGINX requires a long list of supporting files and libraries. A Dockerfile that builds an NGINX image must take care to include all of those dependencies in the container or it will fail to work.
What if you want to create a container that runs a more complicated application? What if, for example, you want to build a container that runs the NGINX web server? NGINX requires a long list of supporting files and libraries. A Dockerfile that builds an NGINX image must take care to include all of those dependencies in the container or it will fail to work.

To determine the linked libraries needed by a compiled C program, use the command `ldd`:

Expand Down Expand Up @@ -113,15 +113,15 @@ ls /

File `hello` isn't there. Why not? Because the host filesystem and the container filesystem are completely separate. Creating the "hello" file in the root of the container had no effect on the filesystem of the host.

In this case, typing `exit` in the container kills the container andits application. We can see which containers are running on the hostusing this command:
In this case, typing `exit` in the container kills the container and its application. We can see which containers are running on the host using this command:

`docker ps`

In this case no containers are running. We started only the "hello-world" container, and our `exit` command stopped it.

If we run `docker run -ti ubuntu` again it creates a brand new instance of the Ubuntu container. Because the container instance is freshly created, the `/hello` file won't be there. That file is something that we created by interacting with the container, not a resource that was built into the container image. Because it's not part of the image, it's not present when the container runs.

It's important to remember that changes to a running Docker container dont survive after the container is killed. If you want to add a resource to a Docker container and make it available in all future sessions, then you must modify the Dockerfile to include the resource and then rebuild the image.
It's important to remember that changes to a running Docker container do not survive after the container is killed. If you want to add a resource to a Docker container and make it available in all future sessions, then you must modify the Dockerfile to include the resource and then rebuild the image.

# The Ubuntu Dockerfile

Expand All @@ -144,7 +144,7 @@ The final command in the Dockerfile,

runs bash, ensuring that the container offers users a working shell when it starts up.

Again, the Ubuntu Dockerfile is stored in a repository along with its supporting files, notably including the .tar.gz archive that contains the Ubuntu files.
Again, the Ubuntu Dockerfile is stored in a repository along with its supporting files, notably including the `.tar.gz` archive that contains the Ubuntu files.

![Ubuntu Repo for Docker Build](assets/images/ubunturepo1.png)

Expand Down
45 changes: 22 additions & 23 deletions labs/docker-101/4.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Building A Webserver Container.
# Building w web server container

A Docker container image can run any application you like. Let's build
one that runs a Webserver. The webserver will run whenever the
one that runs a web server. The web server will run whenever the
container image starts up.

The following python command creates and starts a simple webserver:
The following python command creates and starts a simple web server:

```
python -m SimpleHTTPServer 8000
```

To build a container that runs this webserver we need only change the
To build a container that runs this web server we need only change the
`CMD` line of the Dockerfile&mdash;the line that controls the program
that runs when the container starts.

Expand All @@ -30,7 +30,7 @@ Dockerfile options.
* EXPOSE 8000
The EXPOSE command allows us as developers to "build in" documentation of
what ports our application uses. Running this container in future with `-P`
will automatically map any `EXPOSE` ports in the dockerfile to a dynamic port
will automatically map any `EXPOSE` ports in the Dßockerfile to a dynamic port
on our hosts real IP, allowing real remote connections to our service if necessary.
You can see what port has been mapped by using the `docker ps` command as below:

Expand All @@ -50,9 +50,9 @@ Dockerfile options.
* ENTRYPOINT [“python”, “-m”, “SimpleHTTPServer”, “8000”]
Like CMD, the ENTRYPOINT command runs a program, but it also does
something else: it enables us to pass arguments to the program. We
use this feature to pass arguments to Python to start the webserver.
use this feature to pass arguments to Python to start the web server.

Save the Dockerfile in a new directory and build the new webserver
Save the Dockerfile in a new directory and build the new web server
container image:

```
Expand All @@ -64,7 +64,7 @@ Why don't we see any output?

Every time before when we started a container we saw output from the
container's application. The reason we see no output this time is that
our application, a webserver, doesn't print any. So how do we know
our application, a web server, doesn't print any. So how do we know
whether it's running correctly?

Run the following Docker command:
Expand All @@ -74,12 +74,11 @@ docker ps
```

The command lists all running containers&mdash;including the new
webserver image that we created:
web server image that we created:

![docker ps
webserver](assets/images/dockerpsweb.png)
![docker ps](assets/images/dockerpsweb.png)

The webserver is running. Now how do we connect to it?
The web server is running. Now how do we connect to it?

By default Docker gives each container an internal IP address on the
host. We can find out our container's IP address by running `docker
Expand All @@ -89,30 +88,30 @@ container's address, identified as "IPAddress":

![Docker Inspect](assets/images/dockerinspect.png)

Now that we know the IP address and port on which the webserver can be
Now that we know the IP address and port on which the web server can be
reached, we can make a connection.

```
curl http://<container IP>:8000
```

The built-in Python webserver by default serves the contents of its
The built-in Python web server by default serves the contents of its
working directory. Because our Dockerfile copied the Python script to
the root of the container, that's the directory that the webserver
the root of the container, that's the directory that the web server
displays:

![Success](assets/images/success.png)

Success! We can see the webserver running in the container that we
created, and when we connect to the webserver it shows a list of the
Success! We can see the web server running in the container that we
created, and when we connect to the web server it shows a list of the
files in the container's root directory.

## Extra credit

You now know how to `ADD` files to the Docker build process. If you
create a file named "index.html", add some HTML text to it, then use
the Dockerfile to add it to the root of the container, guess what the
new webserver container will serve instead of the directory listing?
new web server container will serve instead of the directory listing?

Give it a try!

Expand All @@ -125,12 +124,12 @@ In this learning lab we have:
* Understood how publicly-available Docker images are built by viewing
their Dockerfiles

* Built and run our own Docker images
* Built and ran our own Docker images

* Connected to a webserver running in a custom Docker container that
* Connected to a web server running in a custom Docker container that
we built

Give yourself a pat on the back, grab a coffee and enjoy the suggested
labs on the next page.
Give yourself a pat on the back, grab a coffee and enjoy the related
Labs.

Thats all folks!
That's all folks!
18 changes: 13 additions & 5 deletions labs/docker-101/docker-101.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"labId": "docker-101",
"title": "Docker 101",
"slug": "Use docker to build and deploy your first container image.",
"slug": "Use Docker to build and deploy your first container image.",
"time": "40",
"tags": [{
"title": "Cloud"
Expand All @@ -15,17 +15,25 @@
"title": "Docker"
}],
"files": [{
"title": "1.md"
"title": "Docker 101",
"file": "1.md"
}, {
"title": "2.md"
"title": "Get or create a Docker image",
"file": "2.md"
}, {
"title": "3.md"
"title": "Build a Docker image",
"file": "3.md"
}, {
"title": "4.md"
"title": "Build a web server container",
"file": "4.md"
}],
"related": [{
"labId": "kubernetes-101",
"title": "Kubernetes: Deploying docker containers into a Kubernetes cluster."
},
{
"labId": "CiscoContainerPlatform-101",
"title": "Automatically provision and use Kubernetes clusters with Cisco Container Platform."
}
],
"authors": [{
Expand Down
Loading

0 comments on commit 0dcac07

Please sign in to comment.