By default, the docker command should run with root privileges. To run Docker as a non-root user in Ubuntu, you have to add the user to the docker group. Otherwise, you will receive an error.
For modern Docker workflows with Kubernetes, the minimal Ubuntu image provides a balance of compatibility, familiarity, performance and size. This is the standard Ubuntu 18.04 LTS image on the Docker Hub. Cloud images also contain the optimised kernel for each cloud and supporting boot utilities. Fully compatible with all Ubuntu packages. Deploy an Ubuntu VM with Docker Engine. This template allows you to deploy an Ubuntu VM with Docker (using the Docker Extension). You can later SSH into the VM and run Docker containers. This Azure Resource Manager template was created by a member of the community and not by Microsoft. Each Resource Manager template is licensed to you under a.
First check if the docker group already exists on your Ubuntu system:
If the group already in there, add the user to the docker group using the usermod command.
Make sure you replace the user_name with your own. To add yourself (the current logged in user), run:
The user needs to Log out and log back into the Ubuntu server so that group membership is re-evaluated. After that the user will be able to run Docker commands without using root or sudo.
If the group does not exist, Create the docker group:
Ubuntu Core For Docker
And restart the docker service: