More Docker changes:

* disable in-network updates
* persistent directory for snark downloads
* listen on port 12345 for i2np connections
* restore multi-stage build
* use better ant target
* allow passing -Xmx via the JVM_XMX variable

Many thanks to LoveIsGrief for the suggestions!
This commit is contained in:
Zlatin Balevsky
2021-04-28 04:12:24 +00:00
parent 20c528debe
commit 8fa70c9cde
4 changed files with 39 additions and 13 deletions

View File

@@ -1,27 +1,29 @@
FROM jlesage/baseimage:alpine-3.10-glibc
FROM jlesage/baseimage:alpine-3.10-glibc as builder
ENV APP_HOME="/i2p"
WORKDIR /tmp/build
COPY . .
# Build package
RUN add-pkg openjdk8-jre
RUN add-pkg --virtual build-base gettext tar bzip2 apache-ant openjdk8
RUN echo "noExe=true" >> build.properties
RUN ant clean pkg
RUN del-pkg build-base gettext tar bzip2 apache-ant openjdk8
RUN add-pkg --virtual build-base gettext tar bzip2 apache-ant openjdk8 \
&& ant preppkg-linux-only \
&& del-pkg build-base gettext tar bzip2 apache-ant openjdk8
# "install" files
RUN mkdir -p ${APP_HOME}
RUN mv pkg-temp/* ${APP_HOME}
FROM jlesage/baseimage:alpine-3.10-glibc
ENV APP_HOME="/i2p"
RUN add-pkg openjdk8-jre
WORKDIR ${APP_HOME}
COPY --from=builder /tmp/build/pkg-temp .
# "install" i2p by copying over installed files
COPY docker/rootfs/ /
# Mount home
# Mount home and snark
VOLUME ["${APP_HOME}/.i2p"]
VOLUME ["/i2psnark"]
EXPOSE 7654 7656 7657 7658 4444 6668 8998 7659 7660 4445
EXPOSE 7654 7656 7657 7658 4444 6668 8998 7659 7660 4445 12345
# Metadata.
LABEL \
@@ -30,3 +32,4 @@ LABEL \
org.label-schema.version="1.0" \
org.label-schema.vcs-url="https://github.com/i2p/i2p.i2p" \
org.label-schema.schema-version="1.0"