Repository navigation
Expand file tree
/
Copy pathContainerfile
More file actions
53 lines (41 loc) · 2.21 KB
/
Copy pathContainerfile
File metadata and controls
53 lines (41 loc) · 2.21 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM eclipse-temurin:25-jdk as build
RUN apt-get update && apt-get install --assume-yes ant git
COPY . /opt/peergos
WORKDIR /opt/peergos
RUN ant dist && java packager/StripNatives.java server/Peergos.jar
ARG TARGETARCH
RUN NACL_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "amd64") && \
SQLITE_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "x86_64") && \
mkdir -p native-libs && \
jar xf server/Peergos.jar \
native-lib/linux/${NACL_ARCH}/libtweetnacl.so \
org/sqlite/native/Linux/${SQLITE_ARCH}/libsqlitejdbc.so && \
cp native-lib/linux/${NACL_ARCH}/libtweetnacl.so native-libs/ && \
cp org/sqlite/native/Linux/${SQLITE_ARCH}/libsqlitejdbc.so native-libs/
# Stray dependency module-info.class files make jdeps treat the fat jar as a named module.
# jdk.naming.dns, jdk.zipfs and jdk.crypto.ec are loaded via service lookup, invisible to jdeps.
RUN mkdir /tmp/classes && cd /tmp/classes && jar xf /opt/peergos/server/Peergos.jar && \
find . -name module-info.class -delete && \
MODULES=$(jdeps --ignore-missing-deps --multi-release 25 --print-module-deps -R .) && \
echo "Linking modules: $MODULES" && \
jlink --add-modules "$MODULES,jdk.naming.dns,jdk.zipfs,jdk.crypto.ec" \
--strip-debug --no-man-pages --no-header-files \
--output /opt/jre && \
rm -rf /tmp/classes
FROM debian:trixie-slim
LABEL org.opencontainers.image.title="Peergos"
LABEL org.opencontainers.image.description="Peergos is a peer-to-peer encrypted global filesystem with fine-grained access control designed to be resistant to surveillance of data content or friendship graphs"
LABEL org.opencontainers.image.source="https://github.com/Peergos/web-ui"
LABEL org.opencontainers.image.licenses="GPLv3"
ENV JAVA_HOME=/opt/jre
ENV PATH="${JAVA_HOME}/bin:${PATH}"
ENV PEERGOS_PATH=/opt/peergos/data
WORKDIR /opt/peergos
RUN mkdir -p /opt/peergos/data
COPY --from=build /opt/jre /opt/jre
COPY --from=build /opt/peergos/server /opt/peergos/server
COPY --from=build /opt/peergos/native-libs /opt/peergos/native-libs
COPY docker-entrypoint.sh /opt/peergos/docker-entrypoint.sh
RUN chmod +x /opt/peergos/docker-entrypoint.sh
ENTRYPOINT ["/opt/peergos/docker-entrypoint.sh"]
EXPOSE 4001 8000