Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM openjdk:8-jre-alpine
  2. ENV LANG=en_US.UTF-8 \
  3. LANGUAGE=en_US:en \
  4. LC_ALL=en_US.UTF-8 \
  5. GLIBC_BASE_URL=https://github.com/sgerrand/alpine-pkg-glibc/releases/download \
  6. GLIBC_PACKAGE_VERSION=2.31-r0 \
  7. USER_HOME_DIR="/root"
  8. #5.更新Alpine的软件源为阿里云,因为从默认官源拉取实在太慢了
  9. RUN echo http://mirrors.aliyun.com/alpine/v3.10/main/ > /etc/apk/repositories && \
  10. echo http://mirrors.aliyun.com/alpine/v3.10/community/ >> /etc/apk/repositories
  11. RUN apk update && apk upgrade
  12. RUN apk add --no-cache tzdata && \
  13. cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
  14. echo "Asia/Shanghai" > /etc/timezone && \
  15. apk del tzdata
  16. RUN apk add --update ttf-dejavu fontconfig
  17. RUN apk add --no-cache ca-certificates bash git openssh zip subversion sshpass curl
  18. RUN apk add --no-cache --virtual=build-dependencies wget \
  19. && ALPINE_GLIBC_BASE_URL="${GLIBC_BASE_URL}/${GLIBC_PACKAGE_VERSION}" \
  20. && ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-${GLIBC_PACKAGE_VERSION}.apk" \
  21. && ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-${GLIBC_PACKAGE_VERSION}.apk" \
  22. && ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-${GLIBC_PACKAGE_VERSION}.apk" \
  23. && cd /tmp \
  24. && wget -q -O "/etc/apk/keys/sgerrand.rsa.pub" "https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub" \
  25. && wget "${ALPINE_GLIBC_BASE_URL}/${ALPINE_GLIBC_BASE_PACKAGE_FILENAME}" \
  26. "${ALPINE_GLIBC_BASE_URL}/${ALPINE_GLIBC_BIN_PACKAGE_FILENAME}" \
  27. "${ALPINE_GLIBC_BASE_URL}/${ALPINE_GLIBC_I18N_PACKAGE_FILENAME}" \
  28. && apk add --no-cache \
  29. "${ALPINE_GLIBC_BASE_PACKAGE_FILENAME}" \
  30. "${ALPINE_GLIBC_BIN_PACKAGE_FILENAME}" \
  31. "${ALPINE_GLIBC_I18N_PACKAGE_FILENAME}" \
  32. && /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 \
  33. && apk del build-dependencies \
  34. && rm -rf /etc/apk/keys/sgerrand.rsa.pub \
  35. && rm -rf /tmp/*
  36. RUN apk add --update --no-cache ttf-dejavu fontconfig && rm -rf /var/cache/apk/*
  37. RUN java -version