Deploying your first Docker Container

Jon Goldman
2 min readNov 30, 2019

--

In this first scenario, you’ll take the role of Little Billy, a developer who needs to deploy a new Key-Value Store for an application. After discussions, it’s been decided to use Redis, a popular KV Store.

Little Billy is unfamiliar with how Redis is deployed but has heard Docker makes it straightforward to deploy services into development and production.

This scenario discusses how he will complete his task and deploy Redis as a Docker Container.

Little Billy’s development environment has access to latest version of the Docker Engine via a machine called docker. His local dev machine has the Docker Client installed and accessible via the command line.

What is Docker?

Docker is “an open platform for developers and sysadmins to build, ship, and run distributed applications”.

Docker allows you to run containers. A container is a sandboxed process running an application and its dependencies on the host operating system. The application inside the container considers itself to be the only process running on the machine while the machine can run multiple containers independently.

To find an image for Redis you would use: docker search redis

TASK

With search command Little Billy identified that Redis Docker image is called redis and wants to run the latest release. Because Redis is a database, Little Billy wants to run it as a background service while he continues to work.

To complete this step, launch a container int he background running an instance of Redis based on the official image.

There is a run command in the Docker CLI, which will start a container based on a Docker Image.

By default, Docker will run the latest version available. Since this is the first time Little Billy using the Redis image, it will be downloaded onto the Docker Host machine.

dock ps command lists all running containers:

--

--

Jon Goldman
Jon Goldman

Written by Jon Goldman

Cloud Security, Automation, DevOps, AWS, Azure, GCP

No responses yet