Install Docker on Ubuntu 18.04

Continuing to our series Docker for Beginners, In the previous post we’ve seen What is Docker and its related terminologies. In this post we will be seeing how one can get started with Docker i.e. Installation of Docker on Ubuntu 18.04.

So let’s get started.

Step 1: Update your Ubuntu system and  Install Prerequisite Packages for Docker

sudo apt update
sudo apt upgrade
sudo apt-get install curl apt-transport-https ca-certificates software-properties-common

Step 2: Add the Docker Repositories

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
apt-cache policy docker-ce

Step 3: Use the apt command to install Docker

sudo apt install docker-ce

Step 4: Start and Automate Docker on startup

sudo systemctl start docker
sudo systemctl enable docker

Step 4: Verify

docker --version

docker -version
docker -version

Step 5: Run container

sudo docker container run hello-world
docker hello-world
docker hello-world

So, this is how you can get started with Docker, In the next post we will be seeing how to pull existing image from Docker hub and get inside the docker container.



Categories: DevOps, Docker

Tags: , , , , , , ,

1 reply

Trackbacks

  1. Docker run Container and get inside it – THE NUCLEAR GEEKS

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: