This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
forked from jnightlee/webdav-teambition
-
Notifications
You must be signed in to change notification settings - Fork 137
/
Dockerfile
32 lines (31 loc) · 1.43 KB
/
Dockerfile
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
28
29
30
31
32
FROM ubuntu:22.04 as builder
# Allow ubuntu to cache package downloads
RUN rm -f /etc/apt/apt.conf.d/docker-clean
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y curl build-essential libz-dev zlib1g-dev
RUN curl -sL https://get.graalvm.org/jdk | bash -s --
ENV LANG=C.UTF-8
RUN cd /graalvm* \
&& GRAALVM_PATH=$(pwd) \
&& echo $GRAALVM_PATH \
&& echo "export PATH=\"$GRAALVM_PATH/bin:\$PATH\"" >> /tmp/env \
&& echo "export JAVA_HOME=\"$GRAALVM_PATH\"" >> /tmp/env
COPY ./build.gradle /tmp/webdav-aliyundriver/build.gradle
COPY ./gradle /tmp/webdav-aliyundriver/gradle
COPY ./gradlew /tmp/webdav-aliyundriver/gradlew
COPY ./settings.gradle /tmp/webdav-aliyundriver/settings.gradle
COPY ./gradle.properties /tmp/webdav-aliyundriver/gradle.properties
RUN --mount=type=cache,target=/root/.gradle,sharing=private \
. /tmp/env && cd /tmp/webdav-aliyundriver && ./gradlew --info dependencies
COPY ./ /tmp/webdav-aliyundriver
RUN --mount=type=cache,target=/root/.gradle,sharing=private \
. /tmp/env \
&& cd /tmp/webdav-aliyundriver \
&& ./gradlew nativeCompile --no-daemon
RUN chmod +x /tmp/webdav-aliyundriver/build/native/nativeCompile/webdav-aliyundriver
FROM ubuntu:22.04
COPY --from=builder /tmp/webdav-aliyundriver/build/native/nativeCompile/webdav-aliyundriver /webdav-aliyundriver
ENV LANG=C.UTF-8
EXPOSE 8080
ENTRYPOINT ["/webdav-aliyundriver"]