3

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

3

1 Answer 1

7

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.