Home  >  Article  >  Operation and Maintenance  >  Can docker copy the image environment?

Can docker copy the image environment?

尚
Original
2020-04-01 13:06:284673browse

Can docker copy the image environment?

How docker copies the image environment:

(1) Export the image on the existing mirror system

docker save microservice_img > /z/microservice_img.tar

The image is saved as an image file (mirror Already exists):

docker save -o update1.tar update (update is an existing image)

(2) Copy the docker image to the corresponding system, such as centos;

(3) Start docker on the corresponding computer

#Restart docker

sudo systemctl restart docker

(4) Import the image (two ways)

#Import the image file

docker load --input /z/microservice_img.tar

#Import through symbols

docker load < /z/microservice_img.tar

(5) Check whether the image is imported successfully

Execute the command: docker images

docker images -a

(6) Run the image in the container

# Run the microservice_img image in the new test container

docker run -it -p 8899:8899 --name test microservice_img

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of Can docker copy the image environment?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn