Docker Installation and commands

sudo apt-get remove docker docker-engine docker.io containerd runc

sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
“deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable”
sudo apt-get updatesudo apt-get install docker-ce docker-ce-cli containerd.iosudo groupadd docker
$ sudo usermod -aG docker $USER
sudo reboot
docker build -t image_name .
service docker start
docker images
docker ps
docker run -p 8081:8081 image-id
docker login
docker tag image_tag_name path_of_docker:image_name
docker push path_of_image
docker pull path_of_image:image_name
docker run -p 8081:8081 image_tag_name
docker run -p 3000:3000 -it image_path:image_name

--

--

DevOps/Cloud | 2x AWS Certified | Terraform | Gitlab

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store