0% found this document useful (0 votes)
5 views1 page

Docker Install

This document provides a step-by-step guide for deploying Docker on an Ubuntu Linux virtual machine. It includes commands for updating the package index, installing necessary packages, adding Docker's GPG key, setting up a stable repository, and installing Docker. Additionally, it demonstrates how to launch a Docker container running Nginx.

Uploaded by

kumar4dellemc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Docker Install

This document provides a step-by-step guide for deploying Docker on an Ubuntu Linux virtual machine. It includes commands for updating the package index, installing necessary packages, adding Docker's GPG key, setting up a stable repository, and installing Docker. Additionally, it demonstrates how to launch a Docker container running Nginx.

Uploaded by

kumar4dellemc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab - Deploying Docker on a virtual machine - Practice commands

You can use the following commands to work with Docker on an Ubuntu Linux virtual
machine

OR

You can also refer to Docker documentation -


https://docs.docker.com/engine/install/ubuntu/

// Update the package index

sudo apt-get update

// Install packages to allow apt to use the repository over HTTPS

sudo apt-get install \


ca-certificates \
curl \
gnupg \
lsb-release
// Add Docker's official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o


/usr/share/keyrings/docker-archive-keyring.gpg
// Setup a stable repository

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-
archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >
/dev/null
// Update the package index

sudo apt-get update

// Install docker, containerd

sudo apt-get install docker-ce docker-ce-cli containerd.io


// Launching a container

sudo docker run --name mynginx -p 80:80 -d nginx

You might also like