Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run docker compose file without internet connection

I have a .NET project with docker support, so I run docker-compose.yml with docker-compose.override.yml file - Windows OS with Linux docker containers.

My idea is to download all necessary images and then run that same docker-compose file without internet connection. So, i will have connection initially, download all the images, and then go offline and run the app.

Any idea how can I do that?

like image 555
zlaayaa Avatar asked Oct 20 '25 12:10

zlaayaa


1 Answers

Do below steps

  • First over the internet get to build all required docker images.
  • Then save/export those images in the tar file by using below command

    docker save image_name > /image/mynewimage.tar

  • The go offline, copy those tar file on another or same machine and load those images by using below command

    docker load < /image/mynewimage.tar

  • Then run normal docker run commands, you already have got all images locally hence docker will not try to get it download from the internet.

This should work, let me know if you need any help with this.

Please post your docker-compose file, if in case of any issue with above approach.

like image 173
Rohan J Mohite Avatar answered Oct 23 '25 03:10

Rohan J Mohite



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!