From f8fc228af155e33e4aaa2fd6d5247936b13e81fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Thu, 12 Nov 2026 13:51:34 +0100 Subject: [PATCH] 0.36.12: docker fixes --- Dockerfile | 37 +++++++++++++++---- .../routeros-oci-build/.env.routeros.example | 14 +++---- integrations/routeros-oci-build/.gitignore | 1 + .../routeros-oci-build/Dockerfile.routeros | 2 +- integrations/routeros-oci-build/README.md | 22 +++++------ 5 files changed, 50 insertions(+), 26 deletions(-) create mode 100644 integrations/routeros-oci-build/.gitignore diff --git a/Dockerfile b/Dockerfile index bbd89aa..375444b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,49 @@ # syntax=docker/dockerfile:1 -FROM rust:1.99-trixie AS build + +FROM rust:1.99.1-trixie AS build + WORKDIR /build COPY . . + RUN if [ ! -f Cargo.lock ]; then cargo generate-lockfile; fi \ && cargo build --locked --release + FROM debian:trixie-slim AS runtime + RUN apt-get update \ - && apt-get install -y --no-install-recommends ca-certificates python3 python3-venv python3-pip openssl certbot \ - python3-certbot-dns-cloudflare python3-certbot-dns-ovh python3-certbot-dns-rfc2136 \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + python3 \ + python3-venv \ + python3-pip \ + openssl \ && rm -rf /var/lib/apt/lists/* \ && groupadd --system --gid 10001 rustproxy \ - && useradd --system --uid 10001 --gid rustproxy --home /var/lib/rustproxy --shell /usr/sbin/nologin rustproxy \ + && useradd \ + --system \ + --uid 10001 \ + --gid rustproxy \ + --home /var/lib/rustproxy \ + --shell /usr/sbin/nologin \ + rustproxy \ && install -d -o rustproxy -g rustproxy -m 0700 /var/lib/rustproxy \ && install -d -o rustproxy -g rustproxy -m 0750 /var/log/rustproxy + COPY --from=build /build/target/release/rust-proxy /usr/local/bin/rust-proxy + USER rustproxy:rustproxy -ENV RUST_PROXY_DATA_DIR=/var/lib/rustproxy \ + +ENV RUST_LOG=rust_proxy=info,warn \ + RUST_PROXY_DATA_DIR=/var/lib/rustproxy \ + RUST_PROXY_ADMIN_LISTEN=0.0.0.0:9090 \ RUST_PROXY_PROXY_LISTEN=0.0.0.0:8080 \ - RUST_PROXY_ADMIN_LISTEN=127.0.0.1:9090 \ + RUST_PROXY_TLS_LISTEN=0.0.0.0:8443 \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + VOLUME ["/var/lib/rustproxy"] + EXPOSE 8080 8443 9090 + ENTRYPOINT ["/usr/local/bin/rust-proxy"] -CMD ["serve"] +CMD ["serve", "--allow-remote-admin"] \ No newline at end of file diff --git a/integrations/routeros-oci-build/.env.routeros.example b/integrations/routeros-oci-build/.env.routeros.example index 9c91c88..b48f231 100644 --- a/integrations/routeros-oci-build/.env.routeros.example +++ b/integrations/routeros-oci-build/.env.routeros.example @@ -1,11 +1,11 @@ # Zot / OCI registry. Do not include a path in REGISTRY. -REGISTRY=zot.example.net +REGISTRY=oci.example.net IMAGE_NAME=network/rustproxy # Alternative shorthand instead of REGISTRY + IMAGE_NAME: -# OCI_IMAGE=zot.example.net/network/rustproxy +# OCI_IMAGE=oci.example.net/network/rustproxy -# Zot Basic Auth / htpasswd or token credentials. +# oci Basic Auth / htpasswd or token credentials. OCI_USERNAME= OCI_PASSWORD= # OCI_TOKEN= @@ -14,8 +14,8 @@ OCI_PASSWORD= BUILD_PLATFORMS=linux/amd64,linux/arm64 BUILDER=rustproxy-routeros -# RustProxy currently requires Rust 1.88. -RUST_VERSION=1.88 +# RustProxy currently requires Rust 1.99.1. +RUST_VERSION=1.99.1 DEBIAN_SUITE=trixie # Empty OCI_TAG means the script uses Cargo.toml package version. @@ -29,11 +29,11 @@ OCI_NO_CACHE=0 OCI_VERIFY=1 OCI_PROGRESS=plain -# 1 stores BuildKit cache in Zot as IMAGE_NAME:buildcache. +# 1 stores BuildKit cache in oci as IMAGE_NAME:buildcache. # Recommended for CI/ephemeral buildx builders. OCI_REGISTRY_CACHE=0 -# Optional BuildKit config, useful for an internal Zot with a custom CA. +# Optional BuildKit config, useful for an internal oci with a custom CA. # BUILDER_CONFIG=/etc/buildkit/buildkitd.toml # Optional manual repository root override. diff --git a/integrations/routeros-oci-build/.gitignore b/integrations/routeros-oci-build/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/integrations/routeros-oci-build/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/integrations/routeros-oci-build/Dockerfile.routeros b/integrations/routeros-oci-build/Dockerfile.routeros index 2cc41a2..7b7e22b 100644 --- a/integrations/routeros-oci-build/Dockerfile.routeros +++ b/integrations/routeros-oci-build/Dockerfile.routeros @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM rust:1.99-trixie AS build +FROM rust:1.99.1-trixie AS build WORKDIR /build COPY . . diff --git a/integrations/routeros-oci-build/README.md b/integrations/routeros-oci-build/README.md index 9886f2f..247071e 100644 --- a/integrations/routeros-oci-build/README.md +++ b/integrations/routeros-oci-build/README.md @@ -43,18 +43,18 @@ cp integrations/routeros-oci-build/.env.routeros.example \ integrations/routeros-oci-build/.env ``` -Then edit the Zot address and credentials. +Then edit the oci address and credentials. -## Zot example +## oci example ```env -REGISTRY=zot.example.net +REGISTRY=oci.example.net IMAGE_NAME=network/rustproxy OCI_USERNAME=builder OCI_PASSWORD=secret BUILD_PLATFORMS=linux/amd64,linux/arm64 -RUST_VERSION=1.88 +RUST_VERSION=1.99.1 DEBIAN_SUITE=trixie ``` @@ -80,9 +80,9 @@ ENV_FILE=integrations/routeros-oci-build/.env \ For example, with RustProxy version `0.36.12` and the defaults this publishes: ```text -zot.example.net/network/rustproxy:0.36.12 -zot.example.net/network/rustproxy:latest -zot.example.net/network/rustproxy:routeros +oci.example.net/network/rustproxy:0.36.12 +oci.example.net/network/rustproxy:latest +oci.example.net/network/rustproxy:routeros ``` Each tag points to the same amd64 + arm64 OCI manifest. @@ -112,13 +112,13 @@ For short-lived CI builders, enable registry cache: OCI_REGISTRY_CACHE=1 ``` -It is stored in Zot as: +It is stored in oci as: ```text -zot.example.net/network/rustproxy:buildcache +oci.example.net/network/rustproxy:buildcache ``` -## Custom/self-signed Zot CA +## Custom/self-signed oci CA Point `BUILDER_CONFIG` to a BuildKit configuration that trusts the registry CA, for example: @@ -132,7 +132,7 @@ Docker itself must also trust the registry CA for `docker login` and manifest in - Docker Engine - Docker Buildx -- access to the Zot/OCI registry +- access to the oci/OCI registry - an existing RustProxy `Cargo.lock` Do not add an ARM-native Rust builder stage. Doing that would put `rustc` and Cargo back under QEMU on an amd64 host.