sgerrand / alpine-pkg-glibc

A glibc compatibility layer package for Alpine Linux
2.04k stars 280 forks source link

Error character map file UTF-8' not found: No such file or directory #202

Open Adriano-Silva-DEV opened 1 year ago

Adriano-Silva-DEV commented 1 year ago

Hello, I have the following problem using FROM mcr.microsoft.com/dotnet/aspnet:7.0.5-alpine3.17-amd64 :

Step 19/28 : RUN /usr/glibc-compat/bin/localedef -i pt_BR -f UTF-8 pt_BR.UTF-8 ---> Running in 406a6949b93f [91m[error] character map file UTF-8' not found: No such file or directory [0m [91m[error] default character map file ANSI_X3.4-1968' not found: No such file or directory [0mThe command '/bin/sh -c /usr/glibc-compat/bin/localedef -i pt_BR -f UTF-8 pt_BR.UTF-8' returned a non-zero code: 4

b01 commented 1 year ago

@Adriano-Silva-DEV Can yo provide a sample of your Dockerfile? What version of this glibc lib did you install?

I tried with the following Dockerfile: user 2.35-r1 (note the 1 instead of 0); but could not reproduce.

ARG ALPINE_VER=3.17
ARG GLIBC_VER=2.35-r1

FROM mcr.microsoft.com/dotnet/aspnet:7.0.5-alpine${ALPINE_VER}-amd64

ARG GLIBC_VER

# Install vanilla GLibC: https://github.com/sgerrand/alpine-pkg-glibc
WORKDIR /tmp

RUN 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 \
 && apk add --force-overwrite glibc-${GLIBC_VER}.apk

RUN 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 --force-overwrite glibc-bin-${GLIBC_VER}.apk glibc-i18n-${GLIBC_VER}.apk

RUN /usr/glibc-compat/bin/localedef -i pt_BR -f UTF-8 pt_BR.UTF-8

# Cleanup
RUN rm -vrf /var/cache/apk/* \
 && rm -rf /tmp/* \
 && rm /etc/apk/keys/sgerrand.rsa.pub

ENTRYPOINT [ "sh" ]

CMD [ ]

I built the image with the command:

docker build -f .\Dockerfile2 --no-cache --rm --tag dot-net-img --progress plain .

Then ran and logged into the container to look around:

docker run -it --rm --name dotnet dot-net-img