Open vbuterin2 opened 3 years ago
I'm having the same issue. Here's my DOCKERFILE:
FROM python:3.9.2-alpine
# Install language pack
# https://github.com/gliderlabs/docker-alpine/issues/144#issuecomment-436455850
RUN echo "https://dl-3.alpinelinux.org/alpine/v3.13/main" >> /etc/apk/repositories
RUN echo "https://dl-3.alpinelinux.org/alpine/v3.13/community" >> /etc/apk/repositories
ENV LD_LIBRARY_PATH=/lib64
RUN apk --no-cache add --update ca-certificates wget curl && \
GLIBC_VER="2.32-r0" && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-${GLIBC_VER}.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-i18n-${GLIBC_VER}.apk && \
apk add glibc-bin-${GLIBC_VER}.apk glibc-i18n-${GLIBC_VER}.apk glibc-${GLIBC_VER}.apk
# Iterate through all locale and install it
# Note that locale -a is not available in alpine linux, use `/usr/glibc-compat/bin/locale -a` instead
COPY . /flipp_scraper/
RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
# Set the lang, you can also specify it as as environment variable through docker-compose.yml
ENV LANG='en_US.UTF-8' LANGUAGE='en_US.UTF-8'
EDiT: Switching to 2.29-r0 also fixed the issue for me as well. Thanks for the suggestion, @epvanhouten !
Looks like glibc > v2.29 is copying ld-{VERSION}.so to ld-linux-x86-64.so.2 instead of creating a symlink.
Adding this to my Dockerfile after installing glibc fixed the problem for me (use your desired glibc version on line 2):
RUN rm /usr/glibc-compat/lib/ld-linux-x86-64.so.2 && \
ln -s ld-2.33.so /usr/glibc-compat/lib/ld-linux-x86-64.so.2
$ # Alpine v3.15.0 + glibc v2.34-r0 @ 2021/11/30
... ** snip ** ...
(1/2) Installing glibc (2.34-r0)
ERROR: glibc-2.34-r0: trying to overwrite lib64/ld-linux-x86-64.so.2 owned by libc6-compat-1.2.2-r7.
In my case, removing libc6-compat
from apk add
fixed the issue.
apk add --no-cache \
- bash build-base file git gzip ncurses libc6-compat \
+ bash build-base file git gzip ncurses \
\
GLIBC_VER="2.34-r0" && \
wget -q https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-${GLIBC_VER}.apk && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk && \
apk add --no-cache \
glibc-${GLIBC_VER}.apk \
glibc-bin-${GLIBC_VER}.apk
$ # Alpine v3.15.0 + glibc v2.34-r0 w/out libc6-compat
... **snip ** ...
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/2) Installing glibc (2.34-r0)
(2/2) Installing glibc-bin (2.34-r0)
Executing glibc-bin-2.34-r0.trigger
OK: 234 MiB in 56 packages
I think I'm seeing this same issue. My reproduction is as follows:
Running under Docker version 19.03.5, build 633a0ea838f10e000b7c6d6eed1623e6e988b5bb
Results in the following output:
Using
GLIBC_VER="2.29-r0"
eliminates the error. Removing attempting to install theglibc-bin-v2.32-r0.apk
package also eliminates the error.