Write the Dockerfile file in the current path, and then execute it on the terminal in the current path

sudo docker build -t myname:v0 .
Copy the code

Don’t forget the last one.

You can then use Docker Images to view the image

[error: Got permission denied while trying to connect to the Docker daemon socket at Unix :///var/] Solution 1: Run the sudo command again

** Scheme 2 ** : Add ordinary users to the Docker groupCopy the code
sudo gpasswd -a username docker
newgrp docker
Copy the code