Docker Community Forums

Share and learn in the Docker community.

Create Docker Image as part of the build process

Hi,
we are thinking about how the creation of docker image is integrated into our build process and I have the following naive “way” how this could be done.

  1. The goal is to have a docker image, that we can “put on a DVD” and send to our customers.
  2. Build our projects.
  3. Post builds in our Visual Studio projects are copying the binaries and the Dockerfile to a specific “Docker Image” directory.
  4. A script or something invokes the Docker Engine and creates Docker Image (e.g. “Docker run…”).
  5. I invoke “Docker save” and put the exported TAR-file on our dvd.

Exists something like a “best practice” or a recommended approach for Step #4?
Best Regards,
Christian

“Put on a DVD and send” is pretty 2005 :stuck_out_tongue:
If possible for you, you can just upload the image to a (private) registry. You can have private images on docker hub, or the even better way would be to host your own registry inhouse and publish the images there. Your customers can then just login to your registry and download their images.

Hi,
thank your very much, for your help!
Well, the problem is, that some of our customers are banks or from the public sector. The server on that our solution is running has hat these customers really no (!!) internet access. Because of this, we have to go the old way.

Hi
I’m doing something similar for a huge (5G) windows app with Jenkins.
I’d suggest “Docker build” in the development CI a Docker image including a script that runs the app. Then “Docker save” it to a TAR file and send to the customer somehow (DVD) with "Docker load and run instructions.
Eitan

1 Like

Hi Eitan,
thank you a lot for your feedback.
Could you please tell me, for what you are using Jenkins and why you are using this and not another tool?
Christian

Hi Christian

I’m using Jenkins as this is the standard CI tool in this project. The main thing in our case (a legacy monolith app.) was to package all that needed to run the program into a single Docker image.

Eitan