mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-03 16:27:48 +00:00
[SIS-xxx] reducing size of bot image
This commit is contained in:
@@ -1,8 +1,32 @@
|
|||||||
FROM amazoncorretto:17.0.8-alpine3.18
|
# https://careers.wolt.com/en/blog/tech/how-to-reduce-jvm-docker-image-size
|
||||||
MAINTAINER Sheldan
|
FROM amazoncorretto:17.0.14-alpine3.20 AS corretto-jdk
|
||||||
VOLUME /tmp
|
|
||||||
ADD config/* /config/
|
RUN apk add --no-cache binutils
|
||||||
ADD wrapper/*.sh /
|
|
||||||
|
RUN $JAVA_HOME/bin/jlink \
|
||||||
|
--verbose \
|
||||||
|
--add-modules ALL-MODULE-PATH \
|
||||||
|
--strip-debug \
|
||||||
|
--no-man-pages \
|
||||||
|
--no-header-files \
|
||||||
|
--compress=2 \
|
||||||
|
--output /customjre
|
||||||
|
|
||||||
|
FROM alpine:3.21
|
||||||
|
|
||||||
|
ENV JAVA_HOME=/jre
|
||||||
|
ENV PATH="${JAVA_HOME}/bin:${PATH}"
|
||||||
|
|
||||||
|
COPY --from=corretto-jdk /customjre $JAVA_HOME
|
||||||
|
|
||||||
|
ARG APPLICATION_USER=appuser
|
||||||
|
|
||||||
|
RUN adduser --no-create-home -u 1000 -D $APPLICATION_USER
|
||||||
|
|
||||||
|
RUN mkdir /app && chown -R $APPLICATION_USER /app
|
||||||
|
|
||||||
|
COPY --chown=1000:1000 config/* /config/
|
||||||
|
COPY --chown=1000:1000 wrapper/*.sh /
|
||||||
RUN chmod +x /start.sh
|
RUN chmod +x /start.sh
|
||||||
ADD bot/app.jar /app.jar
|
COPY --chown=1000:1000 bot/app.jar /app.jar
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
Reference in New Issue
Block a user