Docker installation in Ubuntu 20.04
The following tutorial describes how to install and docker docker-compose Ubuntu 20.04.
Made with just a few steps.
For a start we will install Docker will do this with the command:
1 | sudo apt install docker.io |
Then add the service to the system:
1 | sudo systemctl enable --now docker |
The command sudo without a docker
Docker default management requires administrator privileges.
To run the command docker as a user other than root sudo without preparation, you need to add a user to a group.
1 | sudo usermod -aG docker nasz_użytkownik |
Docker we check the version by typing:
1 | docker --version |
Test run, we can make the container using the command:
1 | docker run hello-world |
A whole should work correctly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ |
Installation docker-compose
We make install command:
1 | apt install docker-compose |
We check the version command:
1 | docker-compose version |
1 2 3 4 | docker-compose version 1.21.0, build unknown docker-py version: 3.4.1 CPython version: 3.7.5 OpenSSL version: OpenSSL 1.1.1c 28 May 2019 |