Rework Dockerfile for multi-arch release builds - #21
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## develop #21 +/- ##
========================================
Coverage 44.96% 44.96% ========================================
Files 25 25 Lines 3398 3398 Branches 259 259 ========================================
Hits 1528 1528 Misses 1824 1824 Partials 46 46 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR prepares PhotoCleaner’s Docker build layer for an upcoming release/publisher workflow by reworking the Dockerfile for multi-architecture builds and adding a Docker Hub-focused README.
Changes:
- Reworks
Docker/Dockerfileto build onBUILDPLATFORMand cross-publish toTARGETARCH, and to accept fleet-style build/version args. - Ensures central build/package configuration files are copied into the build context so restore/publish works with central package management.
- Adds
Docker/README.mdintended to populate the Docker Hub repository description.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Docker/Dockerfile | Multi-arch-oriented build stage, build-arg contract support, and runtime image labeling/tool install. |
| Docker/README.md | Adds Docker Hub README content describing project links, tags, and license info. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
Docker/Dockerfile:25
- BuildKit sets TARGETARCH to values like "amd64" and "arm64", but dotnet publish --arch expects .NET arch names (for example x64, arm64). Passing "$TARGETARCH" through directly will likely fail or publish for the wrong architecture on amd64 builds.
RUN dotnet publish PhotoCleaner/PhotoCleaner.csproj \
--arch "$TARGETARCH" \
--configuration "$BUILD_CONFIGURATION" \
Docker/Dockerfile:35
- LABEL_VERSION has a quoted default. Docker keeps the quotes as part of the value, which can result in a label value like '"1.0.0.0"'.
ARG LABEL_VERSION="1.0.0.0"
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Rework Dockerfile for multi-arch release builds; add Docker Hub README Release-pipeline infrastructure (issue #14 item 8): - Dockerfile: build on $BUILDPLATFORM and cross-publish to $TARGETARCH (no QEMU for the compile), accept the NBGV version build-args (BUILD_VERSION/FILE/ASSEMBLY/INFORMATION/PACKAGE), BUILD_CONFIGURATION, and LABEL_VERSION. Copy Directory.Build.props / Directory.Packages.props / .editorconfig so the versionless (central package management) PackageReference items resolve during restore - without them the publish fails with NETSDK1013 (TargetFramework ''). Keeps the Alpine base. - Docker/README.md: Docker Hub repository overview (project links, tag scheme, license), pushed by the docker build task's dockerhub-description step. Verified: docker buildx build --platform linux/amd64 succeeds and the image runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Address review: reference-style Docker README, Release build default - Docker/README.md: convert to reference-style links per the carried AGENTS.md Documentation Style rule (human-facing docs use reference-style; grouped and alphabetized). - Dockerfile: default BUILD_CONFIGURATION to Release so a bare `docker build` with no args produces a Release image (the pipeline always passes it explicitly, so no pipeline impact). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Move Docker/README.md to the pipeline PR The Docker Hub overview describes the weekly rebuild schedule and is pushed by the docker build task, both of which land in the workflow pipeline PR. Keeping the README with them avoids asserting a schedule that does not exist yet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Split semicolon-joined clause in Dockerfile header comment Per the AGENTS.md character-set rule against semicolons joining independent clauses in agent-authored prose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
First of two release-pipeline PRs (issue #14 item 8). Prepares the Docker build layer that the workflow-pipeline PR drives. (Docker/README.md moved to the pipeline PR, where the weekly scheduler that its text describes also lands.)
$BUILDPLATFORMand cross-publish to$TARGETARCH(--arch), so the compile needs no QEMU emulation - only the runtime layer is per-arch. Accepts the NBGV version build-args (BUILD_VERSION/BUILD_FILE_VERSION/BUILD_ASSEMBLY_VERSION/BUILD_INFORMATION_VERSION/BUILD_PACKAGE_VERSION),BUILD_CONFIGURATION(default Release), andLABEL_VERSION, matching the fleet build-args contract. Keeps the Alpine base.Directory.Build.props,Directory.Packages.props, and.editorconfig. After central package management landed (Adopt central package management and LangVersion #19), the versionlessPackageReferenceitems needDirectory.Packages.propspresent during restore; without itdotnet publishfails withNETSDK1013: TargetFramework ''. Confirmed the current develop Dockerfile fails this way, and the reworked one builds and runs.Testing
docker buildx build --platform linux/amd64succeeds with both explicit and default build-args; the image runs (--help).🤖 Generated with Claude Code