Repository navigation
Conversation
97a86b1 to
f997555
Compare
|
IMHO this PR is now starting to mix too many things and it's hard to follow, what change is done for what reason now. Please split this into individual commits at least.
Which typically adds a lot of bloat as well. So please check what impact this has on the image size. Comparing the package lists and only adding what seems reasonably might be an idea as well. There haven't been a lot of complaints, and that might be a better balance between compatibility and image size. |
Fair, I am going to drop the |
I think, this makes a lot of difference. As states this in #10854:
I would also suggest to just install the missing packages as reported by users instead of doing the same thing what the old image did. That way, we would at least know why we're installing that many packages in our official image. |
832fa6a to
7ef7c92
Compare
|
@julianbrost: Please take another look. The container image now copies everything from icinga2-plugins-container, pinned to the "wandering" tag |
7ef7c92 to
e73194f
Compare
| COPY --from=ghcr.io/icinga/icinga2-plugins-container:trixie /usr/lib/nagios/plugins/* /usr/lib/nagios/plugins/ | ||
| COPY --from=ghcr.io/icinga/icinga2-plugins-container:trixie /plugins.cdx.json /usr/share/sbom/ | ||
|
|
||
| # Install the necessary runtime dependencies for the Icinga 2 binary and the monitoring-plugins. | ||
| RUN apt-get update && \ | ||
| apt-get upgrade -y && \ | ||
| RUN --mount=from=ghcr.io/icinga/icinga2-plugins-container:trixie,target=/plugins \ |
There was a problem hiding this comment.
I'd introduce a build ARG for the image name. That avoids repeating it three times now and has the added benefit that you can build against a different version for testing purposes without having to modify the file.
There was a problem hiding this comment.
Thought about that but wanted to keep the diff small. Now, there is a global DEBIAN_VERSION to substitute trixie.
There was a problem hiding this comment.
Containerfile:122
--------------------
121 | # Install the necessary runtime dependencies for the Icinga 2 binary and the monitoring-plugins.
122 | >>> RUN --mount=from=ghcr.io/icinga/icinga2-plugins-container:${DEBIAN_VERSION},target=/plugins \
123 | >>> apt-get update && \
124 | >>> DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
125 | >>> DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
126 | >>> bc \
127 | >>> ca-certificates \
128 | >>> curl \
129 | >>> dumb-init \
130 | >>> file \
131 | >>> libboost-context1.83.0 \
132 | >>> libboost-coroutine1.83.0 \
133 | >>> libboost-date-time1.83.0 \
134 | >>> libboost-filesystem1.83.0 \
135 | >>> libboost-iostreams1.83.0 \
136 | >>> libboost-program-options1.83.0 \
137 | >>> libboost-regex1.83.0 \
138 | >>> libboost-system1.83.0 \
139 | >>> libboost-thread1.83.0 \
140 | >>> libcap2-bin \
141 | >>> libedit2 \
142 | >>> libldap-common \
143 | >>> libmariadb3 \
144 | >>> libmoosex-role-timer-perl \
145 | >>> libpq5 \
146 | >>> libprotobuf-lite32t64 \
147 | >>> libssl3 \
148 | >>> libsystemd0 \
149 | >>> mailutils \
150 | >>> monitoring-plugins \
151 | >>> msmtp \
152 | >>> msmtp-mta \
153 | >>> openssh-client \
154 | >>> openssl \
155 | >>> $(cat /plugins/debian-packages) && \
156 | >>> # Official Debian images automatically run `apt-get clean` after every install, so we don't need to do it here.
157 | >>> rm -rf /var/lib/apt/lists/*
158 |
--------------------
ERROR: failed to build: failed to solve: dockerfile parse error on line 122: 'from' doesn't support variable expansion, define alias stage instead
-- https://github.com/Icinga/icinga2/actions/runs/43001166329/job/130457548175
Oh noe :(
I have tested this locally with Podman, where it worked. So, I am going to undo this change, as otherwise there would be ARG usage everywhere except here, which would look very bug-ish.
There was a problem hiding this comment.
Undo.
FTR: It looked like this: https://github.com/Icinga/icinga2/compare/e73194f333e5d2fbca05e6fdb4c7e5dfcb55da6f..edc4c7661745e92a9849c6c6b180111e810699a4
There was a problem hiding this comment.
Wait, I would test if creating an intermediate stage would do.
Sorry using this thread as a chat with myself.
There was a problem hiding this comment.
One more try. As I just rumbled, I created an intermediate container stage where the ARG substitution is used in the FROM. It worked locally with Podman and the CI is past that step; seems to be working. Yay.
There was a problem hiding this comment.
and has the added benefit that you can build against a different version for testing purposes without having to modify the file
By only having DEBIAN_VERSION as an ARG, this doesn't really solve what I had in mind there. With the current state, you can't (without editing the file) build this based on an edge version of that image (or a local name of that image).
There was a problem hiding this comment.
Okay, I failed to peek into your mind correctly.
I have changed this to introduce an additional PLUGINS_VERSION ARG, defaulting to the DEBIAN_VERSION. Now it is possible to overwrite the Debian main version - including the plugins - as well as just overwriting the plugin version with --build-args.
Was that what you had in mind? Otherwise, please feel free to suggest changes.
There was a problem hiding this comment.
I had hoped this doesn't need much peeking into my mind. 😅
I'd introduce a build
ARGfor the image name.
So that would be ARG PLUGINS_IMAGE=ghcr.io/icinga/icinga2-plugins-container:trixe and using that. This allows using --build-arg PLUGINS_IMAGE=ghcr.io/icinga/icinga2-plugins-container:trixe-edge or also --build-arg PLUGINS_IMAGE=localhost/plugins:dev.
e73194f to
edc4c76
Compare
e1c9113 to
ce19ebd
Compare
Outsource pinned check commands to an external container image[0]. This uncouples their versions from our Containerfile, belonging to a certain git tag. Afterward, the plugins can be updated independently of an Icinga 2 release. Furthermore, the new container image[0] comes with an SBOM of all check plugins. When inspecting the container image, these artifacts are now being picked up. [0]: https://github.com/Icinga/icinga2-plugins-container
ce19ebd to
cc06caa
Compare
Outsource pinned check commands to an external container image1. This uncouples their versions from our Containerfile, belonging to a certain git tag. Afterward, the plugins can be updated independently of an Icinga 2 release.
Furthermore, the new container image1 comes with an SBOM of all check plugins. When inspecting the container image, these artifacts are now being picked up.
Fixes Icinga/docker-icinga2#170
Refs #10984
Footnotes
https://github.com/Icinga/icinga2-plugins-container ↩ ↩2