사용자 도구

사이트 도구


java:openjdk:docker

문서의 이전 판입니다!


OpenJdk Docker

Temurin - docker

alipine 회피

  • JDK 16 부터는 나아졌다는 얘기가 있으나(JEP 386: Alpine Linux Port) alpine-musl 과 JDK간의 조합이 여러가지 문제를 일으키는 경우가 있다.
  • glibc 기반인 centos, 혹은 debian 계열 docker 이미지를 사용하는게 나아보인다.
  • temurin docker의 설명에서도 alpine 계열에 문제가 있을 수 있음이 나온다.(2022년 현재)
This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use musl libc instead of glibc and friends, so software will often run into issues depending on the depth of their libc requirements/assumptions. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

기본 배포판

  • openjdk:<version> : Debian 기반
  • openjdk:<version>-alpine : Alpine Linux 기반
FROM openjdk:8-alpine

# Timezone 보정
RUN apk add tzdata
RUN cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
RUN echo "Asia/Seoul" > /etc/timezone

ENV LANG=ko_KR.UTF-8

# Java application 실행 설정
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN javac Main.java
CMD ["java", "Main"]

참조

java/openjdk/docker.1644990500.txt.gz · 마지막으로 수정됨: 2022/02/16 14:48 저자 kwon37xi