How to pack docker image in one file

I have a 5 GB docker image named "ubuntu-dev-update-15" that I developed on my local Ubuntu 14 dev machine. In this image, I have everything that is needed to complete my work. Now I need to send this image to another linux host. What is the procedure for doing this?

+4
source share
3 answers

get an account on the docker hub.

https://hub.docker.com/account/signup/

after registration (only once), you enter from the host that has the image you want to click:

docker login
    (login with your username, password, and email address)

then you push your image there. you may have to tag it first. let's say you created a new mynewacc account, firstly, you tag your image:

docker tag ubuntu-dev-update-15 mynewacc/ubuntu-dev-update-15

:

docker push mynewacc/ubuntu-dev-update-15

- :

docker pull mynewacc/ubuntu-dev-update-15

:

docker run -it mynewacc/ubuntu-dev-update-15 /bin/bash

, , . , . -g

0

linux , FTP HTTP- , . Save:

docker save [OPTIONS] IMAGE [IMAGE...]

: sudo docker save -o ubuntu.tar ubuntu:precise ubuntu:unicorn

-o , STDOUT. tar linux. tar , : docker load [OPTIONS]

: sudo docker load --input fedora.tar

--input tar STDIN.

+8

- - . ( ) , .

For example, you want to send your image from system1 to system2. Let your image name be my_image.

Now open the registry in system1 by running

docker run -p <system1-ip>:5000:5000 -d registry

Click the image in this registry:

You need to rename the image with: 5000 / my_image using the tag option

docker tag my_image <system1-ip>:5000/my_image

Now click on the registry using the push command

docker push <system1-ip>:5000/my_image

Now go to system2 and pull out the image from the registry.

  docker pull <system1-ip>:5000/my_image

This is the safest way to transfer images. Link create a private repository

+1
source

All Articles