*Introduction*
This article will help you through docker configuration, downloading and building a container image.
*Prerequisites*
You must have installed the VM ware Work Station Pro
Downloaded and configured your Ubuntu Desktop.
*STEP ONE: Pasting URL*
Open your broswer and paste the URL:https://docs.docker.com/engine/install/ubuntu/
If copied correctly, you should be presented with the page as shown below.
*STEP TWO: Setting up Repository*
The next step is to set up the docker repository to enable you install and update docker from the repository.
Copy and paste the following command on your terminal:
*sudo su*
The above command will require the password used in setting up the Ubuntu desktop. Once inputted, copy and paste the following commands accordingly:
Your screen should appear like this
Next, copy and paste the paste the command to add Docker official GPG Key
- Then, set up the repository with the code below
*STEP THREE:Install Docker Engine*
- First you will have to update the apt package index with the command below
After sucessfully updating, we will go with installing the latest version of your docker engine.
Next step is to verify the successful installation of your emgine by running the command below:
*STEP FOUR: Download a Container Image*
Go to *https://hub.docker.com/*
Click on Explore and search for Nginx
On the left hand side of your screen, copy *docker pull nginx*
Paste the copied command in your terminal and hit enter to download the container image in your local environment.
*STEP FIVE: Start a Container Image*
On your terminal, run the command *docker run nginx --detach --publish-all nginx:latest*
Copy your IP address and port number.
- Go to your browser and type: *ip address:port* You show see something like the picture below
*STEP SIX: Build a Container Image*
Follow the following steps to build the specified image.
Create a directory and change to the directory created by running the following command. In this tutorial, our directory will be named *cloud*
*mk dir cloud*
*cd cloud*
Create a linux text document called *Dockerfile* using the command *vim Dockerfile*
If done correctly, your screen should appear like the one below
Paste the following into the text editor. N/B You can only input anything into the text editor by pressing your "I" button
*FROM* ubuntu****
*MAINTAINER (your email address)*
*CMD ['echo', 'hello world']*
Press *esc, *shift + :, then type **wq**** to save your text
Exit the text editor by pressing enter
Build the container image using the following code
*docker build -t (name of your choice) .*
Top comments (0)