snehilchopra / OpenTelemetry-StarterProject

1 stars 1 forks source link

Docker-izing Error Fix : Use debian testing as base image #2

Open snehilchopra opened 4 years ago

snehilchopra commented 4 years ago

Problem

Earlier during the internship, C++ interns working on the Starter Project were facing an error while deploying the 3 services to GKE. The error had something to do with missing dependencies while running docker containers with debian-9 base images.

The exact error was

/lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29 not found 
/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.26 not found

Solution

Per my conversation with @proppy , it seems like the base argument of the cc_image rule was using gcr.io/distroless/cc by default, which had really old versions for both libc and libstdc++.

Tried updating to debian 10 (https://github.com/GoogleContainerTools/distroless/blob/master/cc/BUILD#L9), but the version of the libc6 was also not recent enough (2.28): https://tracker.debian.org/pkg/glibc.

Given that there is no distroless image for debian testing (11), we went for the official image https://hub.docker.com/_/debian, which did the trick.

In the end, it was a matter of finding a base image that had the right dependencies. Moreover, it seems like the bazel build is making some strong assumption on the libc version.

Feel free to correct me if there's something wrong with the explanation, @proppy . Thank you so much for your time and effort!

Code changes for adding debian testing base image: #1
Code changes for docker port mapping using bridge networks: #3

proppy commented 4 years ago

Moreover, it seems like the bazel build is making some strong assumption on the libc version.

It would be interesting to see what in the OpenTelemetry build tie the whole thing to a specific version of gllibc.