Files
secs-gem/interop/secs4j/Dockerfile
raphael 5fec47ad02 ci: bake secs4j harness into image instead of bind-mounting
Second secs4j-interop CI failure:
  ensuring secs4j-interop image is built...
  compiling Secs4jHostHarness.java...
  error: file not found: Secs4jHostHarness.java
  FAIL: javac

The script bind-mounted $PWD/interop/secs4j into /work inside the
container so it could javac the harness at runtime.  That works
locally where docker daemon and script share a filesystem, but
fails in CI: the act runner runs the workflow inside a container,
the docker socket is mounted from the host, and the daemon
interprets bind-mount paths against the host filesystem — where
$PWD/interop/secs4j doesn't exist.  Result: empty /work, javac
errors, job fails.

Fix: COPY Secs4jHostHarness.java into the image and javac it at
image build time.  The script just runs the container — no bind
mount, no docker-in-docker mount path translation, works in CI and
locally.

Verified locally with a fresh image rebuild: 55/55 checks pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 19:54:32 +02:00

43 lines
1.7 KiB
Docker

FROM eclipse-temurin:21-jdk
# secs4java8 (kenta-shimizu) is a second independent SECS/HSMS
# implementation in Java. We use it as a third-party peer to
# cross-validate our C++ server against — distinct author, distinct
# language ecosystem, distinct interpretation of the SEMI standards.
# If both libraries agree on wire bytes, that's much stronger evidence
# of spec-correctness than either alone.
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
bash \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt
# Pin to a tagged release if/when one becomes available; until then,
# pin to a known-working commit via depth=1 + checkout. Replace with
# a SHA in CI for full reproducibility.
RUN git clone --depth 1 https://github.com/kenta-shimizu/secs4java8.git secs4java8
WORKDIR /opt/secs4java8
# secs4java8 ships a compile.sh that builds Export.jar. Run it once
# at image build so the harness can just include the resulting jar.
RUN bash compile.sh
# Bake the harness into the image and compile it here.
#
# The previous arrangement bind-mounted the harness from the host at
# runtime, which fails when this script runs inside a CI container
# whose docker socket points at a daemon on a different filesystem —
# the host path interop/secs4j doesn't exist on the docker daemon's
# side, so `docker run -v $PWD/interop/secs4j:/work` mounts an empty
# directory and javac reports "file not found." Copying the source
# in at build time avoids the docker-in-docker volume problem
# entirely.
WORKDIR /work
COPY Secs4jHostHarness.java /work/
RUN javac -cp /opt/secs4java8/Export.jar Secs4jHostHarness.java