How to deploy / propagate 'own image' ...?

I have built a web application on my laptop (Python, Flask) and run it in a container. I first created a Dockerfile, created an image with it and then instantiated a container with the image. So far so good.

Now I want to deploy the application to a product environment, in my case a Synology NAS. How can I best do that?

My idea now is to push the created image from my laptop to a local repository / registry (according to this tutorial Host your own docker registry | Local Docker Registry | Docker Registry using Docker Compose - YouTube). And then (from the NAS) pull this image and start a container with it on the NAS.

Is pretty straight forward, but requires me to create a local repo. That implies an extra component and I only want to do that if it is really necessary? My original thought was to copy the image from my laptop to the NAS, but I looked it up and concluded that is not possible, but maybe I’m wrong. Another option that I see is to push my image to Docker Hub, and pull it back from there, but I prefer to keep the image local.

What is the best way forward ?

The local repo is the BEST way, also remember that you have a free private docker hub repo you can use, then no one else is able to pull it.

alternative the only posibility i can recall is that you use “docker save” to tar.gz your image so you can transfer it manually (docker save | Docker Documentation) to your NAS, to then use “docker load” to import the image (docker load | Docker Documentation)

Clear instructions!

Maybe I’ll set up a repo locally later.

I was not aware of Docker Hub’s private option and tried it out.
Had it up & running within an hour:

  • Private repo created @ Docker hub

  • Laptop: image properly tagged + login from a terminal @ Docker Hub + push image

  • Ssh into NAS + login from a terminal @ Docker Hub + pull image + run container.

Worked right away!

Thanks, Ko

1 Like