Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): Add runtime image based on Debian #285

Open
wants to merge 1 commit into
base: primary
Choose a base branch
from

Conversation

sklirg
Copy link
Member

@sklirg sklirg commented Jan 11, 2023

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.

$ podman image ls | grep -e skogul -e e7e56
<none>                                         <none>                    e7e5619d2654  About a minute ago  147 MB
ghcr.io/telenornms/skogul                      v0.18.0                   b10226d1676a  3 months ago        1.07 GB

Size difference:
<none> is an image built using this change,
ghcr.io/telenornms/skogul is v0.18.0 from GHCR.

$ podman image ls | grep -e skogul -e e7e56
<none>                                         <none>                    e7e5619d2654  About a minute ago  147 MB
ghcr.io/telenornms/skogul                      v0.18.0                   b10226d1676a  3 months ago        1.07 GB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant