peimanja / artifactory_exporter

JFrog Artifactory Prometheus Exporter written in Go
Apache License 2.0
140 stars 37 forks source link

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./artifactory_exporter) #127

Closed althaser closed 5 months ago

althaser commented 6 months ago

$ docker images |grep artifactory_exporter peimanja/artifactory_exporter latest 013ff29faee7 5 days ago 34.8MB

$ docker run peimanja/artifactory_exporter:latest -h ./artifactory_exporter: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found (required by ./artifactory_exporter) ./artifactory_exporter: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.32' not found (required by ./artifactory_exporter)

KacperPerschke commented 6 months ago

Reproduction attempt

$ docker image pull peimanja/artifactory_exporter
⋮
$ docker image ls peimanja/artifactory_exporter
REPOSITORY                      TAG       IMAGE ID       CREATED      SIZE
peimanja/artifactory_exporter   latest    013ff29faee7   9 days ago   34.8MB
$ docker run peimanja/artifactory_exporter:latest -h
./artifactory_exporter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./artifactory_exporter)
./artifactory_exporter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./artifactory_exporter)

Initial diagnosis

Dockerfile uses golang:1.21, with CGO_ENABLED=1 set, which means it compiles binaries dynamically linked to glibc. At the same time, Debian 11 was used as the base for the final image, which has an older glibc than golang 21 wants to have.

Solution?

There are two ways:

  1. build statically linked
  2. upgrade debian version

I'll try the first one.

KacperPerschke commented 6 months ago

@althaser please watch pull request #128. Could you run from branch Issue_127 on my fork and check that it works?

gh repo clone KacperPerschke/artifactory_exporter your_local_fork_clone
cd your_local_fork_clone
git checkout Issue_127
docker build -t yourLocalNameOfTheProducedImage -f Dockerfile .
althaser commented 5 months ago

Hi @KacperPerschke

I just noticed your message now, I have built the image from your branch and it worked properly:

$ docker run Issue_127:latest -h
usage: artifactory_exporter [<flags>]

Flags:
  -h, --help                    Show context-sensitive help (also try
                                --help-long and --help-man).
      --log.format=logfmt       Output format of log messages. One of: [logfmt,
                                json]
      --log.level=info          Only log messages with the given severity or
                                above. One of: [debug, info, warn, error]
      --web.listen-address=":9531"  
                                Address to listen on for web interface and
                                telemetry.
      --web.telemetry-path="/metrics"  
                                Path under which to expose metrics.
      --artifactory.scrape-uri="http://localhost:8081/artifactory"  
                                URI on which to scrape JFrog Artifactory.
      --artifactory.ssl-verify  Flag that enables SSL certificate verification
                                for the scrape URI
      --artifactory.timeout=5s  Timeout for trying to get stats from JFrog
                                Artifactory.
      --optional-metric=metric-name ...  
                                optional metric to be enabled. Pass multiple
                                times to enable multiple optional metrics.
      --version                 Show application version.

thanks

KacperPerschke commented 5 months ago

@althaser wrote

… from your branch and it worked properly …

Thanks.