2、Common commands

2.1、do not use the sudo command

Usually, to operate docker commands, you need to add the prefix sudo, as follows:

But after adding the docker user group, you don't need to add the sudo prefix. How to add a docker user group (run commands in the host running docker):

After adding the above command, use the [docker images] command to test, if there is no error, it means that you can already use the sudo command. If the following error is reported:

Run the following command on the host to solve the problem:

2.2、help commands

2.3、mirror command

1、Docker pull download image

2、Docker images lists the images

3、docker search

4、docker rmi delete the image

2.4、container commands

To create a container with an image, we use the image of ubuntu here to test and download the image:

1、docker run

2、docker ps

3、Exit the container

4、Multiple terminals enter a running container

5、Start and stop the container

6、Delete the container

2.5、common other commands

  1. View the process information running in the container and support ps command parameters.

 

2、View the metadata of the container/image

2.6、Command Summary

image-20230424144541215