Description
In the third step of the Dockerfile, when building the final image, some unnecessary packages might be installed into the final image. This results in an excessively large image (around 1GB) for a lightweight software like dagu.
Based on the following section of the Dockerfile:
https://github.com/dagu-org/dagu/blob/main/Dockerfile#L30-L45,
I analyzed which packages might be unnecessary or contribute significantly to the image size:
git: A version control tool. Since the final runtime environment does not need to access the source code repository, this can be removed.
curl/wget: I'm not sure if dagu's HTTP executor uses shell commands to make requests. If it uses Go's HTTP client instead, these can also be removed.
zip/unzip: Since dagu is unlikely to execute zip/unzip operations via shell, these should not be necessary.
build-essential: The build process has already been split into two stages. By the time the final image is built, both the frontend and backend of dagu should be compiled. Only the binary needs to be copied into the final image, so this package is unnecessary.
python3/python3-pip: I'm not entirely sure about this. However, as a Go application running in Docker, dagu should not require a Python environment. Users installing on bare-metal systems will likely configure their environment themselves.
openjdk-11-jdk: Similar to Python, this package provides a Java development environment, but dagu does not appear to rely on Java. If I missed something, and Java is indeed required at runtime, openjdk-11-jre is recommended instead to reduce image size.
nodejs/npm: These provide a JavaScript runtime and build environment. However, since the frontend has already been built and bundled into the Go binary, they are unnecessary in the final image.
If you’d like, I can help modify the dockerfile.