0

I am using a dind image. Every time I create a container based on it, I have to download the images again, it takes a lot of time. The question is, how can you put images in a container (image) in advance? I've tried using Volumes and a couple more tries.

Nick ODell
  • 15,465
  • 3
  • 32
  • 66
fabelx
  • 197
  • 1
  • 12
  • 2
    One approach would be to use `docker save` to produce a .tar file which contains the image, and use `docker load` to import it again. – Nick ODell Jun 18 '21 at 20:07
  • Related questions: 1) [How do I pre-pull containers?](https://stackoverflow.com/questions/58749344/pre-pull-images-in-docker-in-docker-dind) 2) [How do I share images between host and child docker?](https://stackoverflow.com/questions/22387969/share-images-between-host-and-child-docker) – Nick ODell Jun 18 '21 at 20:18
  • Since the `docker:dind` image declares a `VOLUME` for the Docker storage, this isn't possible. Using Docker-in-Docker at all is pretty unusual; can you reuse the host's Docker daemon for your workload? (Or, use a tool like Packer to build a virtual-machine image with Docker and its images preloaded?) – David Maze Jun 21 '21 at 10:12

0 Answers0