Build the api outside the image it ships in #61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "build-outside"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
deploy/api.Dockerfileran cargo inside the image build, so it needed theprivate registry from in there. That is why
shippassed--network=hostandmounted cargo credentials as a build secret — a debt this repository has been
carrying with a note attached saying it gives up build isolation instead of
giving a route.
The route was already on the runner. It carries the Rust toolchain and the
registry credentials that guard's clippy and tests use on every run. So
shipnow builds the release binary first, stages it beside the Dockerfile, and the
Dockerfile drops to a runtime stage that copies it.
--secret id=cargo--network=hostA
.dockerignorearrives with it: the context is now what the runtime stageactually reads, rather than
target/andnode_modules/being handed to thedaemon on every build.
Verified by building the image with neither the secret nor the host network and
running it —
bootstrapandserveboth resolve.This is the decision recorded as 15 in the task line. The alternative
considered and rejected was putting the api binary into
[release] binariesso the image could copy a release artifact. That field is not an inventory of
what the repository produces; it is the set a generated manager installs onto
a user's PATH, so it would have handed a server binary to everyone installing
the CLI. The repository ships two independent distribution lines and this keeps
them apart.
Guard was run in full on the committed state and is clean, including all six
acts.