Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

Managing Docker Containers

In the modern environment, being proficient at managing containers is an essential skill. In this activity, you will use Docker container management skills to start and stop containers based on images, add and remove images and containers, and monitor and update containers. Completing the lab will demonstrate basic Docker container management skills.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 30m
Clock icon Jan 17, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Practice Docker by Running the hello-world and busybox Images

    If docker is installed and the docker.service enabled, then a great way to test the ability to run a container is to use the docker subcommand run with a simple image like hello-world. The busybox image is another simple image that we will pull and run a command in. The ps subcommand is useful for viewing running or all containers, and images will list the images in the local repository. Using the rm subcommand we can remove containers and with rmi images.

    sudo -i
    docker run hello-world
    docker run --name hi hello-world
    docker search busybox
    docker pull
    docker run --name busy -it busybox /bin/sh
    docker ps -a # shows a <name> for hello-world
    docker rm <name>
    docker rm hi
    docker ps -a
    docker images
    docker rmi hello-world
    docker images
  2. Challenge

    Create an apache2 Container Based On the Image httpd:2.4 Mapping localhost:8080 to the Container Port 80

    Use docker run to create a container named apache2, based upon the httpd:2.4 image, and map the HTTP port with -p 8080:80.

    docker run --name apache2 -p 8080:80 httpd:2.4 
    #Use CTRL+C to exit output from running container
    docker ps
    docker ps -a
    docker start apache2
    docker logs apache2
    docker stats apache2
    lynx -dump http://localhost:8080
  3. Challenge

    In the apache2 Container, Update the Default index.html file, Then Verify and Commit the Changes

    docker exec -it apache2 bash
    cd htdocs
    echo 'apache2 container' > index.html
    lynx -dump http://localhost:8080
    docker commit -m 'Updated index.html' apache2
  4. Challenge

    Restart the apache2 Container and Verify Changes Are in Effect

    docker ps
    docker stop apache2
    docker ps -a
    docker start apache2
    lynx -dump http://localhost:8080

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans