Dhanushka Sampath
Dhanushka Sampath

Reputation: 255

Where does the docker images stored in local machine

I created docker a docker image of a spring boot application using the below command

docker build -f Dockerfile -t myimage

once i run the command "docker images" I see that image. Now I want to get that image out my local machine and run on another machine using the below command.

docker run -p 8085:8085 myimage

What are the steps to relocate docker image to another machine over a physical medium?

/var/lib/docker/images/overlay2/imagedb/content

but that local contain .txt files of 6KB. I know normally a docker image is around 600MB in size.

Could anyone please help me to find the exact location.

Thank you

Upvotes: 4

Views: 10415

Answers (1)

Kalanamith
Kalanamith

Reputation: 20678

1.You can export your docker image after building it.

docker build -f Dockerfile -t myimage .

docker save myimage > myimage.tar You will see this in your directory where you execute docker build command.

Then you can load it anywhere else as

docker load < myimage.tar

Other than that if there is a docker repo , you can simply push the docker image.

Reference:- https://docs.docker.com/engine/reference/commandline/export/#options

2.If the other machine can be reachable via a network you can setup the other machine as a docker hub

Upvotes: 8

Related Questions