Here, we will explain how to deploy a docker container without internet access.
1. Go to the project folder and run
```powershell
# Command :
docker build --tag [MY_PROJECT]:x.x .
```
[MY_PROJECT]: is the name of your project. Take the name used in your docker-compose.yaml file
x.x: is the version of your app.
- Now, you can export the image as an archive let this:
docker save -o myfile.tar [MY_PROJECT]:x.x
-
Take a storage device like a USB key or a hard disk, and an usb key and copy myfile.tar on the computer.
-
Now, try to load the image into Docker on the offline computer:
docker load -i path/to/myfile.tar
-
Edit docker-compose.yml, and set the version number to x.x (the one chosen at step 1.)
-
Stop and restart all containers of docker compose. In the project folder , run:
docker-compose down
thendocker-compose up
.
Now you are able to deploy a docker container without Internet access.