Port docker images from other computers to your own computer

Usually, it is very slow to pull the mirror from the Internet, and it may take a lot of time and may interrupt the new download.

When solving this problem, in addition to adding some domestic sources, you can also find them from the people around you. If they have the mirror you want, then you can do this next:

  1. Open the interrupted docker images on other computers to view the mirror list and find the required mirror
  2. docker save -o Saved file name Saved image (the saved file name is the name that needs to be suffixed after the image is saved to the local , such as xxx.tar
  3. After getting the xxx.tar file on this computer: docker load --input xxx.tar or docker load <xxx.tar to import the image to your computer
  4. docker images to see if the image has been on your own list
  5. If you see that the image is added to the list, you can run this image to create a run and enter the docker container:
        
         docker run -it IMAGE ID or REPOSITORY : TAG

    where -t   means let Docker assign a pseudo terminal and bind to the standard input of the container The upper
            -i   means to keep the standard input of the container open.
    Do you want to add / bin / bash to join as needed: means to load the container and run bash, docker must keep a process running, or the entire container will exit. It didn't seem to quit, I added later ...
  6. After entering the docker container from one terminal, you may need to open another terminal and enter the container. Operate different things on the two terminals:

             repeat the command in step 5, the two terminals will run the same process, and cannot work separately.
             
             Docker exec- it CONTAINER ID / bin / bash can achieve the effect
  7.  
Published 18 original articles · won praise 1 · views 2673

Guess you like

Origin blog.csdn.net/taochengwu123/article/details/100085890
Recommended