miroir/Dockerfile
jedarden 603b17f708 P8.1: Simplify Dockerfile to scratch-only, update CI to use /workspace/artifacts/
Changes:
- Dockerfile: Remove multi-stage build, now expects pre-built miroir-proxy-linux-amd64
- Dockerfile: Add inline comment documenting the plan §7 cargo-build template
- CI workflow: Change /workspace/dist → /workspace/artifacts to match plan §7
- CI workflow: Update create-github-release to reference /workspace/artifacts

This aligns with plan §7 and §12: scratch base, no libc, minimal attack surface.
The CI builds the static musl binary separately, then Dockerfile copies it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 07:16:34 -04:00

20 lines
1,004 B
Docker

# ── Scratch image with static musl binary ───────────────────────────────────
# Plan §7: expects miroir-proxy-linux-amd64 to be built by CI and placed in build context
# Build step (plan §7 cargo-build template):
# apt-get install -qy musl-tools
# rustup target add x86_64-unknown-linux-musl
# cargo build --release --target x86_64-unknown-linux-musl -p miroir-proxy
# cargo build --release --target x86_64-unknown-linux-musl -p miroir-ctl
# sha256sum miroir-proxy-linux-amd64 > miroir-proxy-linux-amd64.sha256
FROM scratch
ARG VERSION=0.1.0
ARG REVISION=unknown
LABEL org.opencontainers.image.source=https://github.com/jedarden/miroir
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.revision=${REVISION}
LABEL org.opencontainers.image.licenses=MIT
COPY miroir-proxy-linux-amd64 /miroir-proxy
EXPOSE 7700 9090
ENTRYPOINT ["/miroir-proxy"]
CMD ["--config", "/etc/miroir/config.yaml"]