Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Load the docker image to another server by saving it as a file

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In our work environment, general images are uploaded to the image repository (local or public warehouse) and downloaded to the server when needed. If the server does not have access to the Internet and there is no private warehouse, we need to save the image as a file and upload it to the server and load the image to use it.

1. Save the image as a file

Command:

# docker save-help

Usage: docker save [OPTIONS] IMAGE [IMAGE...]

Save one or more images to a tar archive (streamed to STDOUT by default)

Options:

-o,-- output string Write to a file, instead of STDOUT

Example:

Docker images | grep centos# to view the images to be saved

Centos latest 0f3e07c0138f 2 months ago 220MB

Docker save-o centos.tar centos# saves the image as a centos.tar file, which can be viewed by ls.

2. Load the file into the image

Command:

Docker load-help

Usage: docker load [OPTIONS]

Load an image from a tar archive or STDIN

Options:

-I,-input string Read from tar archive file, instead of STDIN

-Q,-- quiet Suppress the load output

Example: upload the file we saved just now to the server we need

Docker load-I centos.tar

Or:

Docker load

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report