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.

  1. Now, you can export the image as an archive let this:
    docker save -o myfile.tar [MY_PROJECT]:x.x

  2. Take a storage device like a USB key or a hard disk, and an usb key and copy myfile.tar on the computer.

  3. Now, try to load the image into Docker on the offline computer:
    docker load -i path/to/myfile.tar

  4. Edit docker-compose.yml, and set the version number to x.x (the one chosen at step 1.)

  5. Stop and restart all containers of docker compose. In the project folder , run:
    docker-compose down
    then docker-compose up.

Now you are able to deploy a docker container without Internet access.

Written by

Albert Oplog

Hi, I'm Albert Oplog. I would humbly like to share my tech journey with people all around the world.