feat(build): Add runtime image based on Debian #285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a "runtime image" to the current Dockerfile. I decided to do this as a separate change to the one by @n-holmstedt in #277, considering that #277 adds a completely new Dockerfile. If this is accepted, most of my comments in that PR can be disregarded as well :-)
This change adds a "runtime image" to the Dockerfile which is what will be published to the Container Registry. This "runtime image" is based on Debian, instead of being the full Golang build environment. This reduces its size a bit as you can see in the comparison below. This also reduces the potential attack surface of exploiting tools inside the build environment.
I decided to change the default command from simply starting Skogul (which would lead to an error message about missing a configuration file), to launching the default Skogul configuration from docs/examples, as well as changing the log-level. This provides better feedback for someone trying to spin up Skogul as a container, as it would otherwise be completely silent (but listening on the port specified in default config).
All of this can be overridden, e.g. by providing another config file to Skogul (such as through volumes) and/or by altering the startup command.
Size difference:
<none> is an image built using this change,
ghcr.io/telenornms/skogul is v0.18.0 from GHCR.