Last active
December 2, 2019 16:22
-
-
Save linuxfemale/ab1b1c573f96eeaa32aba7bb26abfb9d to your computer and use it in GitHub Desktop.
Docker on Ubuntu 18.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common | |
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 bionic stable" | |
sudo apt update | |
apt-cache policy docker-ce | |
sudo apt install docker-ce | |
sudo systemctl status docker | |
sudo usermod -aG docker ${sifat} | |
su - ${sifat} | |
id -nG | |
sammy sudo docker | |
sudo usermod -aG docker sifatdocker [option] [command] [arguments] | |
docker | |
docker docker-subcommand --help | |
docker info | |
docker run hello-world | |
docker search ubuntu | |
docker pull ubuntu | |
docker images | |
docker run -it ubuntu | |
apt update | |
apt install nodejs | |
node -v | |
docker ps | |
docker ps -a | |
docker ps -l | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
d9b100f2f636 ubuntu "/bin/bash" About an hour ago Exited (0) 10 minutes ago sharp_volhard | |
docker start d9b100f2f636 | |
docker stop sharp_volhard | |
docker rm festive_williams | |
docker commit -m "What you did to the image" -a "Author Name" container_id repository/new_image_name | |
docker commit -m "added Node.js" -a "sammy" d9b100f2f636 sammy/ubuntu-nodejs | |
docker images | |
docker login -u docker-registry-username | |
docker tag sammy/ubuntu-nodejs docker-registry-username/ubuntu-nodejs | |
docker push docker-registry-username/docker-image-name | |
docker push sammy/ubuntu-nodejs | |
#You can now use docker pull sammy/ubuntu-nodejs to pull the image to a new machine and use it to run a new container. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment