Docker save and load images offline

 In some rare occasions, it was beneficial for me to save (export) the docker as a local file and load (import) the local file as docker image. Hence, I am posting the commands to save, load and tag the images to enable offline working with docker.

In order to save the image, first we need to pull the image from a docker registry (default docker hub or any other registry).

Pull docker image:

docker pull postgres:10.6

Save (export) docker image:

docker save -o /tmp/postgres-10.6.tar postgres:10.6

Load (import) docker image:

docker load -i /tmp/postgres-10.6.tar

See the loaded image:

docker images postgres:10.6

Create a new tag from the loaded image:

docker tag postgres:10.6 org.example/postgres:10.6

Comments

Popular posts from this blog

JSON with curl and jq

Import self signed in Linux for Chrome / Chromium headless testing

Colima - Drop In replacement for Docker Desktop for Mac and Linux