forked from I2P_Developers/i2p.i2p
Compare commits
1 Commits
master
...
build-debi
| Author | SHA1 | Date | |
|---|---|---|---|
| c0a0aa7700 |
48
Dockerfile
48
Dockerfile
@@ -1,22 +1,22 @@
|
|||||||
# Use a multi-stage build to reduce the size of the resulting image
|
# Use a multi-stage build to reduce the size of the resulting image
|
||||||
# We need alpine >v3 in order to install an apache-ant > 1.9
|
# We need alpine >v3 in order to install an apache-ant > 1.9
|
||||||
FROM alpine:3 as builder
|
FROM debian:buster-slim as builder
|
||||||
ENV I2P_PREFIX="/opt/i2p"
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Build installer
|
||||||
|
RUN apt-get update \
|
||||||
|
# Workaround for installing openjdk-11-jre-headless
|
||||||
|
&& mkdir -p /usr/share/man/man1 \
|
||||||
|
&& apt-get -qqqy install debhelper ant debconf gettext libgmp-dev po-debconf fakeroot \
|
||||||
|
build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java libjson-simple-java \
|
||||||
|
devscripts libjetty9-java libtomcat9-java libtaglibs-standard-jstlel-java libgetopt-java \
|
||||||
|
bash-completion
|
||||||
|
|
||||||
WORKDIR /tmp/build
|
WORKDIR /tmp/build
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
# Build installer
|
RUN ant debian
|
||||||
RUN apk --no-cache add build-base gettext tar bzip2 apache-ant openjdk8 expect
|
|
||||||
RUN echo "noExe=true" >> build.properties
|
|
||||||
RUN ant installer-linux
|
|
||||||
RUN mkdir -p /opt
|
|
||||||
RUN mv i2pinstall*.jar /tmp/i2pinstall.jar
|
|
||||||
|
|
||||||
# Install i2p using the installer into I2P_PREFIX
|
|
||||||
RUN expect -f ./Docker.expt
|
|
||||||
RUN cd ${I2P_PREFIX}
|
|
||||||
RUN rm -fr man docs *.bat *.command *.app
|
|
||||||
|
|
||||||
# Second stage only using the installer from the last stage
|
# Second stage only using the installer from the last stage
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
@@ -24,23 +24,17 @@ RUN rm -fr man docs *.bat *.command *.app
|
|||||||
# alpine uses musl
|
# alpine uses musl
|
||||||
FROM openjdk:11.0-jre-slim
|
FROM openjdk:11.0-jre-slim
|
||||||
|
|
||||||
ARG I2P_UID=1000
|
|
||||||
ARG I2P_USER=i2p
|
|
||||||
ENV I2P_PREFIX="/opt/i2p"
|
|
||||||
ENV PATH=${I2P_PREFIX}/bin:$PATH
|
|
||||||
|
|
||||||
# "install" i2p by copying over installed files
|
# "install" i2p by copying over installed files
|
||||||
COPY --from=builder /opt/i2p ${I2P_PREFIX}
|
COPY --from=builder /tmp/*.deb /tmp/
|
||||||
|
|
||||||
# Setup user and fix permissions in
|
# Install and configure
|
||||||
RUN adduser --system --uid ${I2P_UID} --home /user ${I2P_USER} \
|
RUN apt-get update -qqq \
|
||||||
&& chown -R ${I2P_USER} /user \
|
&& apt-get -qqqy install geoip-database famfamfam-flag-png \
|
||||||
&& chown -R ${I2P_USER} ${I2P_PREFIX} \
|
&& dpkb -i /tmp/*
|
||||||
&& chmod -R u+rwx ${I2P_PREFIX}
|
|
||||||
|
|
||||||
EXPOSE 7654 7656 7657 7658 4444 6668 8998 7659 7660 4445 15000-20000
|
EXPOSE 7654 7656 7657 7658 4444 6668 8998 7659 7660 4445 15000-20000
|
||||||
|
|
||||||
USER i2p
|
USER i2psvc
|
||||||
ENTRYPOINT [ "/opt/i2p/i2psvc" ]
|
ENTRYPOINT [ "/usr/bin/i2prouter" ]
|
||||||
CMD [ "/opt/i2p/wrapper.config", "wrapper.pidfile=/var/tmp/i2p.pid", "wrapper.name=i2p", "wrapper.displayname=\"I2P Service\"" , "wrapper.statusfile=/var/tmp/i2p.status", "wrapper.java.statusfile=/var/tmp/i2p.java.status", "wrapper.logfile=/var/tmp/wrapper.log" ]
|
CMD start
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user