I am trying to get my feet wet with Docker/containers. I started with this tutorial:
Getting Started · Spring Boot with Docker
It works fine, but I was surprised it is necessary to have the "dockerd" daemon running to build an image. It connects to it using localhost and a port number as part of executing the Maven build. Why is this required (and can it be avoided)? I mean, in many cases the image will have to be run on a separate platform anyway. It is particularly annoying, because I am building on Windows where Docker requires you to have Hyper-V enabled, which causes other issues (for instance that you can't use VMware on the same machine).
Due to the problems, I resorted to building it all inside a Linux VM (which then ran the Docker daemon).
Another thing which might be related to the above: It seems the build process doesn't leave the image on disk; it is installed directly into the repository managed by the Docker daemon. I can then export the image from the command line, and I suppose (haven't tried) this image could be moved to another machine and run from there. But how do I build "just" the image without having it deployed anywhere, etc.? It just needs to produce the artifacts in the local file system and leave it at that. Maybe that would also remove the requirement for having Docker running?
The command the tutorial uses for running Maven is:
./mvnw install dockerfile:build
However, trying alternatives to "install" (such as "package", etc.) seemingly doesn't change the behavior.
You don't need Hyper-V if you work with Windows Containers in process isolation mode and have the newest Docker and Windows 10 Pro updated to ver. 1809 (or just use even earlier Windows Server).
Spring Boot tutorial assumes Linux is needed, so you must run Docker in Linux VM. Btw. dockerd is the main daemon; here you have architecture explained visually: https://docs.docker.com/engine/images/architecture.svg
– Kajsa Gauza Mar 24 '19 at 22:58