2. Common commands for docker image containers

 

2.1. Do not use sudo command

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

However, after adding the docker user group, you do not need to add the sudo prefix. How to add the docker user group (run the command 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 the sudo command can no longer be used. If the following error is reported:

Then execute the following command in the host to solve it:

2.2, Help command

2.3, Image command

1, docker pull download image

2, docker images list images

  1. docker search Search image
  1. docker rmi delete image

2.4. Container command

  1. docker run runs the image to start the container
  1. docker ps lists all running containers
  1. Exit the container
  1. Enter the running container from multiple terminals
  1. Start and stop containers
  1. Delete the container

2.5, other commonly used commands

  1. View the process information running in the container, supporting ps command parameters.
  1. View the metadata of the container/image

 

 

2.6 Command Summary

image-20230424144541215