Line 4: | Line 4: | ||
sudo apt install docker-ce | sudo apt install docker-ce | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Start the docker service and enable it to launch everytime at system boot. | Start the docker service and enable it to launch everytime at system boot. | ||
<syntaxhighlight lang="bash">systemctl start docker</syntaxhighlight> | |||
<syntaxhighlight lang="bash">systemctl enable docker</syntaxhighlight> | |||
Check version of docker: | Check version of docker: | ||
<syntaxhighlight lang="bash">docker version</syntaxhighlight> | |||
Additional: Running Docker for non-root user | Additional: Running Docker for non-root user | ||
Line 18: | Line 17: | ||
Add 'aleks' user. | Add 'aleks' user. | ||
<syntaxhighlight lang="bash">useradd -m -s /bin/bash aleks</syntaxhighlight> | |||
Now add the 'aleks' user to the docker group, then restart the docker service. | Now add the 'aleks' user to the docker group, then restart the docker service. | ||
<syntaxhighlight lang="bash">usermod -a -G docker aleks</syntaxhighlight> | |||
<syntaxhighlight lang="bash">systemctl restart docker</syntaxhighlight> | |||
Test by running the docker hello-world. | Test by running the docker hello-world. | ||
<syntaxhighlight lang="bash">docker run -it hello-world</syntaxhighlight> | |||
Install Docker Compose | Install Docker Compose | ||
<syntaxhighlight lang="bash">sudo apt install docker-compose</syntaxhighlight> | |||
Check version: | Check version: | ||
<syntaxhighlight lang="bash">docker-compose version</syntaxhighlight> | |||
Create Custom Docker Network | Create Custom Docker Network | ||
Check the available docker network on the system. | Check the available docker network on the system. | ||
<syntaxhighlight lang="bash">docker network ls</syntaxhighlight> |
Revision as of 17:49, 16 February 2024
Traefik setup example
Install latest docker-ce:
sudo apt install docker-ce
Start the docker service and enable it to launch everytime at system boot.
systemctl start docker
systemctl enable docker
Check version of docker:
docker version
Additional: Running Docker for non-root user Docker container can be run under the non-root user. We just need to add the user to the docker group.
Add 'aleks' user.
useradd -m -s /bin/bash aleks
Now add the 'aleks' user to the docker group, then restart the docker service.
usermod -a -G docker aleks
systemctl restart docker
Test by running the docker hello-world.
docker run -it hello-world
Install Docker Compose
sudo apt install docker-compose
Check version:
docker-compose version
Create Custom Docker Network
Check the available docker network on the system.
docker network ls