Questions about Docker Automatic Compilation

  docker, question

Now I have an open source project that uses Docker and is developed in JAVA, but now the process of Docker image compilation is that I compile JAVA programs locally, then make Docker images locally, and then push them into DockerHub. However, there are many problems in the middle, such as using them to mirror apt source is slow, push to DockerHub is slower, and DockerHub cloud compilation function cannot be used.

If another method is used, it is to write Dockerfile and let him go to git clone my source code, compile it himself, and finally make it into a mirror image, and then use DockerHub’s online compilation function. However, this will increase the size of the image. For example, I need to install jdk,maven,git and other software to compile JAVA, which I didn’t need originally.

You old iron have what good method.

I have used docker, so it is better to directly use the corresponding image. What is the matter with compilation?