The best way to create docker image “offline insta

2019-08-23 09:11发布

I use docker-compose file to get Elasticsearch Logstash Kibana stack. Everything works fine,

docker-compose build

command creates three images, about 600 MB each, downloads from docker repository needed layers.

Now, I need to do the same, but at the machine with no Internet access. Downloading from respositories there is impossible. I need to create "offline installer". The best way I found is

docker save image1 image2 image3 -o archivebackup.tar

but created file is almost 2GB. During

docker-compose build

command some data are downloaded from the Internet but it is definitely less than 2GB.

What is a better way to create my "offline installer", to avoid making it so big?

1条回答
Juvenile、少年°
2楼-- · 2019-08-23 09:46

The save command is the way to go for running docker images online.

The size difference that you are noticing is because when you are pulling images from a registry, some layers might exist locally and are thus not pulled. So you are not pulling all the image layers, only the ones that you don't have locally.

On the other hand, when you are saving the image to a tar, all the layers need to be stored.

查看更多
登录 后发表回答