diff --git a/src/Dockerfile b/src/Dockerfile index 163cf74..90735a5 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -2,9 +2,12 @@ ARG UBUNTU_VERSION=24.04 # I2P build stage -FROM ubuntu:${UBUNTU_VERSION} AS builder_i2pd +FROM --platform=$BUILDPLATFORM ubuntu:${UBUNTU_VERSION} AS builder_i2pd ARG I2PD_VERSION=2.58.0 ARG I2PD_COMPILER=gcc +ARG BUILDPLATFORM +ARG TARGETPLATFORM +ARG TARGETARCH RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ apt-get -y upgrade && \ @@ -26,12 +29,15 @@ RUN git config --global advice.detachedHead false && \ git clone --depth 1 --branch $I2PD_VERSION https://github.com/PurpleI2P/i2pd.git WORKDIR /BUILD_I2PD/i2pd/build -RUN cmake -DCMAKE_BUILD_TYPE=Release -DWITH_AESNI=ON -DWITH_UPNP=ON . && \ +RUN cmake -DCMAKE_BUILD_TYPE=Release -DWITH_AESNI=${AESNI_SUPPORT:-OFF} -DWITH_UPNP=ON . && \ make -j$(nproc) # Yggdrasil build stage -FROM ubuntu:${UBUNTU_VERSION} as builder_yggdrasil +FROM --platform=$BUILDPLATFORM ubuntu:${UBUNTU_VERSION} as builder_yggdrasil ARG YGGDRASIL_VERSION=v0.5.12 +ARG BUILDPLATFORM +ARG TARGETPLATFORM +ARG TARGETARCH RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ apt-get -y upgrade && \ @@ -56,6 +62,8 @@ RUN git clone --depth 1 --branch v0 https://github.com/oldnick85/yggdrasil_get_k # Final runtime image FROM ubuntu:${UBUNTU_VERSION} +ARG TARGETARCH + RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ apt-get -y upgrade && \ apt-get install -y \ @@ -135,4 +143,4 @@ RUN chmod +x /entrypoint.sh HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD bash -c 'pgrep i2pd && pgrep yggdrasil' -CMD ["bash", "/entrypoint.sh"] \ No newline at end of file +CMD ["bash", "/entrypoint.sh"] diff --git a/src/docker-compose.yml b/src/docker-compose.yml index e0a73a1..357e035 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -25,7 +25,8 @@ services: - TZ=UTC restart: unless-stopped healthcheck: - test: ["CMD", "bash", "-c", "pgrep i2pd && pgrep yggdrasil"] +# test: ["CMD", "bash", "-c", "pgrep i2pd && pgrep yggdrasil"] + test: ["CMD-SHELL", "curl -f http://localhost:7070 || exit 1"] interval: 30s timeout: 10s retries: 3 diff --git a/src/i2pd.conf b/src/i2pd.conf index 858cefd..7bce5d8 100644 --- a/src/i2pd.conf +++ b/src/i2pd.conf @@ -35,7 +35,7 @@ # logfile = /var/log/i2pd/i2pd.log ## Log messages above this level (debug, info, *warn, error, none) ## If you set it to none, logging will be disabled -# loglevel = warn +loglevel = info # show informational messages (including SOCKS startup) ## Write full CLF-formatted date and time to log (default: write only time) # logclftime = true @@ -71,9 +71,17 @@ port = 10765 ## Enable communication through ipv4 -ipv4 = false +# IPv4 networking is required for I2P router connectivity and reseeding. +# Earlier we disabled it to restrict traffic to Yggdrasil only, but that +# prevented the router from ever contacting peers or downloading its +# initial NetDB. Enable at least for bootstrap; once the router has +# peers it will happily tunnel them over Yggdrasil if configured. +ipv4 = true ## Enable communication through ipv6 -ipv6 = false +# This MUST be true so i2pd can talk over the Yggdrasil mesh – without it +# Yggdrasil networking is broken, and the container will not be able to +# reach the I2P network at all. +ipv6 = true ## Enable SSU transport (default = true) ssu = false @@ -146,9 +154,22 @@ port = 4444 # outproxy = http://false.i2p ## httpproxy section also accepts I2CP parameters, like "inbound.length" etc. +# [dns] section removed because the I2PD version used in this image +# does not support a built-in DNS server. Name resolution for .i2p domains +# is performed internally by the SOCKS proxy, so the external DNS listener +# is unnecessary. If you upgrade to a future I2PD release that adds this +# feature, you can restore the section. +# +# [dns] +# ## enable DNS server for resolving *.i2p names +# enabled = true +# address = 0.0.0.0 +# port = 53 + + [socksproxy] ## Uncomment and set to 'false' to disable SOCKS Proxy -# enabled = true +enabled = true ## Address and port service will listen on address = 0.0.0.0 port = 4447