From ab0d418bcbc81e1254bdb7875ec06753e3fd68c5 Mon Sep 17 00:00:00 2001 From: Alexandre Garnier Date: Sat, 24 Feb 2024 14:51:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20deno=20image=20by=20using?= =?UTF-8?q?=20alpine's=20native=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- with-deno/Dockerfile | 60 +------------------------------------------- 1 file changed, 1 insertion(+), 59 deletions(-) diff --git a/with-deno/Dockerfile b/with-deno/Dockerfile index b367203..5bc47be 100644 --- a/with-deno/Dockerfile +++ b/with-deno/Dockerfile @@ -1,65 +1,7 @@ FROM zenika/alpine-chrome USER root - -# install glibc -# inspired by https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc/blob/master/Dockerfile - -ENV LANG=C.UTF-8 - -# NOTE: Glibc 2.35 package is broken: https://github.com/sgerrand/alpine-pkg-glibc/issues/176, so we stick to 2.34 for now -RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \ - ALPINE_GLIBC_PACKAGE_VERSION="2.34-r0" && \ - ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ - ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ - ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ - apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \ - echo \ - "-----BEGIN PUBLIC KEY-----\ - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m\ - y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu\ - tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp\ - m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY\ - KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc\ - Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ - 1QIDAQAB\ - -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget \ - "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ - "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ - "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ - mv /etc/nsswitch.conf /etc/nsswitch.conf.bak && \ - apk add --no-cache --force-overwrite \ - "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ - "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ - "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ - \ - mv /etc/nsswitch.conf.bak /etc/nsswitch.conf && \ - rm "/etc/apk/keys/sgerrand.rsa.pub" && \ - (/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) && \ - echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \ - \ - apk del glibc-i18n && \ - \ - rm "/root/.wget-hsts" && \ - apk del .build-dependencies && \ - rm \ - "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ - "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ - "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" - -# Inspired by https://github.com/hayd/deno-docker/blob/master/alpine.dockerfile -# and https://github.com/denoland/deno_docker/blob/main/bin.dockerfile - -ENV DENO_VERSION 1.28.3 - -RUN apk add --no-cache tini curl && \ - curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip --output deno.zip && \ - unzip deno.zip && \ - rm deno.zip && \ - chmod 755 deno && \ - mv deno /usr/bin/deno && \ - apk del curl +RUN apk add --no-cache tini deno USER chrome ENTRYPOINT ["tini", "--"]