1

I'm working from my local laptop and preparing a Dockerfile that I want to use for deployment later on the server. The problem is server contains only docker client/daemon, but has no connectivity to official docker registry and neither it provides it's own image registry.

Is it possible to build my image locally, ship it to the server and run a container on it without going through the trouble of creating my own image registry?

TheMP
  • 8,257
  • 9
  • 44
  • 73
  • 1
    This might help. [How to copy docker images from one host to another without via repository?](https://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-via-repository) – josepainumkal Jul 19 '17 at 21:09

1 Answers1

2

You can save an image using docker save imagename which creates a tarfile and then use docker load to create an image on the server from that tarfile.

Don't confuse this with docker export which creates a tar from a container. See Difference between save and export in Docker. As shown in that link an exported container might be smaller because it flattens layers. If size matters you might consider commiting a container and exporting it right afterwards.

herm
  • 14,613
  • 7
  • 41
  • 62