Closed i-ky closed 3 years ago
If you need something custom - yes, it is better to make your own images based on official one. Or you can build static module with everything included.
If you need something custom - yes, it is better to make your own images based on official one.
There is no suitable official image for building modules, actually. To build module it is required to pull Zabbix source code of a matching version and, as of today, even configure it. For compatibility it is also desirable to compile module with the same compiler and flags as Zabbix itself.
So I think it would be very nice if Zabbix could provide official images for building loadable modules with Zabbix build dependencies preinstalled, Zabbix sources checked out and configured, compiler flags set as environment variable, etc. Module maintainers would take such image as base for build stage, install module build dependencies and build module. Then as a final stage maintainer would take "runtime" image, install module runtime dependencies and copy module from build stage.
We do not hide our Dockerfiles, so all flags and compilation method is available. Final image, as you suggested, could be old because of new dev-packages as well, which you probably need to compile your module.
We do not hide our Dockerfiles, so all flags and compilation method is available.
That's great, but you can change them at any moment, can't you? I would not want to watch your Dockerfiles to keep mine in sync.
Similarly, Linux distributions don't hide sources for their libcurl
packages, but still curl-config
is a useful tool.
Final image, as you suggested, could be old because of new dev-packages as well, which you probably need to compile your module.
Sorry, I did not get it. Could you please elaborate?
We do not hide our Dockerfiles, so all flags and compilation method is available. Final image, as you suggested, could be old because of new dev-packages as well, which you probably need to compile your module.
hello, can you help me with link to the Dockerfile where to see the assembly of zabbix agent 2 for windows ?
Please check it https://github.com/zabbix/zabbix-docker/blob/trunk/agent2/windows/Dockerfile. Currently we are checking licensing issues, and if everything is ok, will publish images :-)
fixed!
I'am cannot build images
~/zabb/zabbix-docker/Dockerfiles/agent2/windows$ sudo docker build . Sending build context to Docker daemon 14.34kB Step 1/24 : ARG MAJOR_VERSION=5.0 Step 2/24 : ARG ZBX_VERSION=${MAJOR_VERSION}.16 Step 3/24 : ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent2-${ZBX_VERSION} Step 4/24 : ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git Step 5/24 : ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 Step 6/24 : FROM ${BUILD_BASE_IMAGE} as builder pull access denied for zabbix-build-agent, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Please specify correct BUILD_BASE_IMAGE build argument. For example: BUILD_BASE_IMAGE=zabbix/zabbix-build-mysql:agent2-5.0-ltsc2019-latest. You can check list in https://hub.docker.com/r/zabbix/zabbix-build-mysql/tags?page=1&name=ltsc
PS C:\zabbix> ls
Каталог: C:\zabbix
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 15.10.2021 22:09 9621 docker-entrypoint.ps1
-a---- 15.10.2021 22:11 2789 Dockerfile
PS C:\zabbix> docker.exe build .
[+] Building 5.5s (14/16)
[good step]
=> => sha256:a22994ae6a0397ceec7b41ab2a3dd509bb5ba6899f6c3260b9d8b8baa7e09a1d 10.71kB / 10.71kB 0.0s
=> => sha256:90ac3ced7b4ff95f4cc52c313b141949e4c550c282b69d3532c7a16ce0f5c4b8 37.19kB / 37.19kB 0.0s
=> CACHED [stage-1 2/6] WORKDIR C:\zabbix\ 0.0s
=> CACHED [stage-1 3/6] COPY --from=builder [C:\\zabbix2, C:\\zabbix] 0.0s
=> ERROR [stage-1 4/6] COPY [.\\docker-entrypoint.ps1, C:\\zabbix] 0.0s
------
> [stage-1 4/6] COPY [.\\docker-entrypoint.ps1, C:\\zabbix]:
------
failed to compute cache key: "/.\\docker-entrypoint.ps1" not found: not found
what OS do you use?
windows 11
try to specify:
COPY [docker-entrypoint.ps1, C:\\zabbix]
Image documentation says:
This works if
dummy1.so
anddummy2.so
don't have any additional dependencies. That's not always the case. Do you have any suggestions how loadable modules with dependencies should be handled?One workaround I can imagine is to mount dependencies into container as well, but this can get pretty brittle and ugly if dependency itself has secondary dependencies (e.g. libcurl with different SSL backends).
Another way is to forget about
ZBX_LOADMODULE
and build an image with a loadable module and all of its dependencies. This is probably too much to ask from end users and such images should be provided by module maintainers. But then we loose "composability", i.e.dummy1.so
anddummy2.so
are provided in different images and it is impossible to use them together, with a single Zabbix agent.Would be nice to know what is your vision of this problem. If there are tips for loadable module maintainers and users, then please add them to the documentation.