2. docker image container common command

 

2. docker image container common command2.1. Not using sudo commands2.2. Help command2.3. Mirror commands2.4 Container Commands2.5 Other common commands2.6 Summary of orders

The operating environment and hardware and software reference configuration are as follows:

 

2.1. Not using sudo commands

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

But after you add a docker usergroup, you can do so without the sudo prefix. docker usergroups are added (by running commands within the host where docker is running):

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

Then execute the following command in the host machine to solve the problem:

 

2.2. Help command

 

2.3. Mirror commands

1, docker pull download image

 

  1. docker images lists the mirrors

 

3, docker search search mirror

 

  1. docker rmi delete image

 

2.4 Container Commands

You can create a container only if you have a mirror, we use ubuntu's mirror to test here, download the mirror:

 

  1. docker run Run the image to start the container

 

  1. docker ps lists all running containers

 

  1. Exit the container

 

  1. Multi-terminal access to running containers

 

  1. Start-stop container

 

  1. Deletion of containers

 

2.5 Other common commands

  1. View information about the processes running in the container, supporting the ps command parameter.

 

2, view the container / image metadata

 

 

2.6 Summary of orders

image-20230424144541215