-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix deno image by using alpine's native package
- Loading branch information
Showing
1 changed file
with
1 addition
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", "--"] |