Prerequisites
64-bit Ubuntu 16.04 server
Ubuntu 16.04 Operating System
Step1 Installing Docker
First, add the GPG key for the official Docker repository to the system:
$curl -fsSL https://download.docker.com/linux/ubuntu/gpg |sudo apt-key add -
Add the Docker repository to APT sources:
$sudo add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
update the package database with the Docker packages
from the newly added repo:
$sudo apt-get update
Make sure you are about to install from the Docker repo
instead of the default Ubuntu 16.04 repo:
$apt-cache policy docker-ce
Check that its Running: $sudo systemctl status docker
Step2 Executing the Docker Command Without Sudo
$sudo usermod -aG docker ${USER}
$sudo usermod -aG docker username
restart the machine $sudo shutdown -r now
verify the docker commands are running without sudo:
$docker info
step3 Working with Docker Images
$docker search ubuntu
$docker pull ubuntu
$docker run ubuntu
$docker images
step4 Running a Docker Container
$docker run -it ubuntu
root@d9b100f2f636:/#
step5 Pushing Docker Images to a Docker Repository
$docker login -u docker-registry-username
$docker push docker-registry-username/docker-image-name
No comments:
Post a Comment