I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 8fa70c9c authored by Zlatin Balevsky's avatar Zlatin Balevsky
Browse files

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!
parent 20c528de
No related branches found
No related tags found
1 merge request!28More Docker changes
FROM jlesage/baseimage:alpine-3.10-glibc FROM jlesage/baseimage:alpine-3.10-glibc as builder
ENV APP_HOME="/i2p" ENV APP_HOME="/i2p"
WORKDIR /tmp/build WORKDIR /tmp/build
COPY . . COPY . .
# Build package RUN add-pkg --virtual build-base gettext tar bzip2 apache-ant openjdk8 \
RUN add-pkg openjdk8-jre && ant preppkg-linux-only \
RUN add-pkg --virtual build-base gettext tar bzip2 apache-ant openjdk8 && del-pkg build-base gettext tar bzip2 apache-ant openjdk8
RUN echo "noExe=true" >> build.properties
RUN ant clean pkg FROM jlesage/baseimage:alpine-3.10-glibc
RUN del-pkg build-base gettext tar bzip2 apache-ant openjdk8 ENV APP_HOME="/i2p"
# "install" files RUN add-pkg openjdk8-jre
RUN mkdir -p ${APP_HOME} WORKDIR ${APP_HOME}
RUN mv pkg-temp/* ${APP_HOME} COPY --from=builder /tmp/build/pkg-temp .
# "install" i2p by copying over installed files # "install" i2p by copying over installed files
COPY docker/rootfs/ / COPY docker/rootfs/ /
# Mount home # Mount home and snark
VOLUME ["${APP_HOME}/.i2p"] 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. # Metadata.
LABEL \ LABEL \
...@@ -30,3 +32,4 @@ LABEL \ ...@@ -30,3 +32,4 @@ LABEL \
org.label-schema.version="1.0" \ org.label-schema.version="1.0" \
org.label-schema.vcs-url="https://github.com/i2p/i2p.i2p" \ org.label-schema.vcs-url="https://github.com/i2p/i2p.i2p" \
org.label-schema.schema-version="1.0" org.label-schema.schema-version="1.0"
# NOTE: This I2P config file must use UTF-8 encoding
#
# If you have a 'split' directory installation, with configuration
# files in ~/.i2p (Linux), %LOCALAPPDATA%\I2P (Windows),
# or /Users/(user)/Library/Application Support/i2p (Mac), be sure to
# edit the file in the configuration directory, NOT the install directory.
# When running as a Linux daemon, the configuration directory is /var/lib/i2p
# and the install directory is /usr/share/i2p .
# When running as a Windows service, the configuration directory is \ProgramData\i2p
# and the install directory is \Program Files\i2p .
#
i2psnark.dir=/i2psnark
router.updateDisabled=true
i2np.ntcp.port=12345
i2np.udp.port=12345
i2np.udp.internalPort=12345
#!/bin/sh #!/bin/sh
set -e set -e
if [ -z $JVM_XMX ]; then
echo "*** Defaulting to 512MB JVM heap limit"
echo "*** You can override that value with the JVM_XMX variable"
echo "*** (for example JVM_XMX=256m)"
JVM_XMX=512m
fi
# Explicitly define HOME otherwise it might not have been set # Explicitly define HOME otherwise it might not have been set
export HOME=/i2p export HOME=/i2p
...@@ -15,7 +22,7 @@ for jar in `ls lib/*.jar`; do ...@@ -15,7 +22,7 @@ for jar in `ls lib/*.jar`; do
CLASSPATH=${CLASSPATH}:${jar} CLASSPATH=${CLASSPATH}:${jar}
done done
JAVAOPTS="-Djava.net.preferIPv4Stack=false -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -Di2p.dir.config=${HOME}/.i2p -DloggerFilenameOverride=logs/log-router-@.txt" JAVAOPTS="-Djava.net.preferIPv4Stack=false -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -Di2p.dir.config=${HOME}/.i2p -DloggerFilenameOverride=logs/log-router-@.txt -Xmx$JVM_XMX"
java -cp "${CLASSPATH}" ${JAVA_OPTS} net.i2p.router.RouterLaunch java -cp "${CLASSPATH}" ${JAVA_OPTS} net.i2p.router.RouterLaunch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment