diff --git a/Dockerfile b/Dockerfile index 4e4bbe82588c2..088d561af7005 100644 --- a/Dockerfile +++ b/Dockerfile @@ -487,5 +487,14 @@ LABEL org.apache.airflow.distro="debian" \ # to learn more about the way how signals are handled by the image ENV DUMB_INIT_SETSID="1" +# This one is to workaround https://github.com/apache/airflow/issues/17546 +# issue with /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block +# We do not yet a more "correct" solution to the problem but in order to avoid raising new issues +# by users of the prod image, we implement the workaround now. +# The side effect of this is slightly (in the range of 100s of milliseconds) slower load for any +# binary started and a little memory used for Heap allocated by initialization of libstdc++ +# This overhead is not happening for binaries that already link dynamically libstdc++ +ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6" + ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"] CMD [] diff --git a/Dockerfile.ci b/Dockerfile.ci index 0e665f37dc76d..b4eb4653c5db0 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -400,6 +400,16 @@ LABEL org.apache.airflow.distro="debian" \ org.opencontainers.image.title="Continuous Integration Airflow Image" \ org.opencontainers.image.description="Installed Apache Airflow with Continuous Integration dependencies" +# This one is to workaround https://github.com/apache/airflow/issues/17546 +# issue with /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block +# We do not yet a more "correct" solution to the problem but in order to avoid raising new issues +# by users of the prod image, we implement the workaround now. +# The side effect of this is slightly (in the range of 100s of milliseconds) slower load for any +# binary started and a little memory used for Heap allocated by initialization of libstdc++ +# This overhead is not happening for binaries that already link dynamically libstdc++ +ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6" + + EXPOSE 8080 ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"]