-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile-multistage-workshop
27 lines (26 loc) · 1.07 KB
/
Dockerfile-multistage-workshop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM ghcr.io/graalvm/graalvm-ce:java8-20.3.3 as graalvm
RUN gu install native-image \
&& mkdir -p /home/app
COPY . /home/app/petclinic
WORKDIR /home/app/petclinic
RUN ./compile-for-container.sh
FROM alpine:latest
MAINTAINER Marthen Luther <[email protected]>
ENV MYSQL_HOST=mysql \
VERSION=v0.12 \
DO_NOT_INITIALIZE=never \
ORACLE_HOST=oracle \
GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc \
# GLIBC_VERSION=2.29-r0 \
GLIBC_VERSION=2.33-r0 \
LANG=C.UTF-8
RUN apk -U upgrade \
&& apk add libstdc++ bash curl \
&& for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION} glibc-i18n-${GLIBC_VERSION}; do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done \
&& apk add --allow-untrusted /tmp/*.apk \
&& rm -v /tmp/*.apk \
&& echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh \
&& /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib
EXPOSE 8080
COPY --from=graalvm /home/app/petclinic/target/petclinic-jpa .
ENTRYPOINT ["/petclinic-jpa"]