Skip to content

Fix for Dockerfiles when building with GoReleaser#793

Merged
javuto merged 1 commit into
mainfrom
fix-issues-new-cicd
Mar 31, 2026
Merged

Fix for Dockerfiles when building with GoReleaser#793
javuto merged 1 commit into
mainfrom
fix-issues-new-cicd

Conversation

@javuto
Copy link
Copy Markdown
Collaborator

@javuto javuto commented Mar 31, 2026

Fixed Dockerfiles when building using GoReleaser

@javuto javuto requested a review from Copilot March 31, 2026 18:48
@javuto javuto added 📦 build Building related issues cicd CICD related issues labels Mar 31, 2026
@javuto javuto merged commit 4a3d2bb into main Mar 31, 2026
10 checks passed
@javuto javuto deleted the fix-issues-new-cicd branch March 31, 2026 18:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the Docker build inputs to match GoReleaser’s produced artifact names/locations so Docker images can be built successfully via GoReleaser.

Changes:

  • Update Dockerfiles to COPY binaries without the .bin suffix.
  • Update GoReleaser dockers.extra_files entries to reference artifacts under dist/.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
deploy/cicd/docker/Dockerfile-osctrl-tls Update binary name copied into image (drop .bin).
deploy/cicd/docker/Dockerfile-osctrl-cli Update binary name copied into image (drop .bin).
deploy/cicd/docker/Dockerfile-osctrl-api Update binary name copied into image (drop .bin).
deploy/cicd/docker/Dockerfile-osctrl-admin Update binary name copied into image (drop .bin).
.goreleaser.yml Point docker extra_files to dist/ artifacts for each component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mkdir -p /opt/osctrl/script && \
chown osctrl-${COMPONENT}:osctrl-${COMPONENT} -R /opt/osctrl
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH}.bin /opt/osctrl/bin/osctrl-${COMPONENT}
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH} /opt/osctrl/bin/osctrl-${COMPONENT}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Dockerfile now copies a binary without the .bin suffix, but the repo’s existing GitHub composite action that builds Docker images prepares the context with osctrl-${component}-${GOOS}-${GOARCH}.bin (see .github/actions/build/docker/action.yml:50-52). Unless that workflow has been retired, this change will make those Docker builds fail. Consider keeping compatibility (e.g., make the suffix configurable via a build-arg) or update the CI action(s) in the same PR.

Copilot uses AI. Check for mistakes.
mkdir -p /opt/osctrl/script && \
chown osctrl-${COMPONENT}:osctrl-${COMPONENT} -R /opt/osctrl
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH}.bin /opt/osctrl/bin/osctrl-${COMPONENT}
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH} /opt/osctrl/bin/osctrl-${COMPONENT}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Dockerfile now copies a binary without the .bin suffix, but the repo’s existing GitHub composite action that builds Docker images prepares the context with osctrl-${component}-${GOOS}-${GOARCH}.bin (see .github/actions/build/docker/action.yml:50-52). Unless that workflow has been retired, this change will make those Docker builds fail. Consider keeping compatibility (e.g., make the suffix configurable via a build-arg) or update the CI action(s) in the same PR.

Copilot uses AI. Check for mistakes.
mkdir -p /opt/osctrl/data && \
chown osctrl-${COMPONENT}:osctrl-${COMPONENT} -R /opt/osctrl
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH}.bin /opt/osctrl/bin/osctrl-${COMPONENT}
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH} /opt/osctrl/bin/osctrl-${COMPONENT}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Dockerfile now copies a binary without the .bin suffix, but the repo’s existing GitHub composite action that builds Docker images prepares the context with osctrl-${component}-${GOOS}-${GOARCH}.bin (see .github/actions/build/docker/action.yml:50-52). Unless that workflow has been retired, this change will make those Docker builds fail. Consider keeping compatibility (e.g., make the suffix configurable via a build-arg) or update the CI action(s) in the same PR.

Copilot uses AI. Check for mistakes.
chown osctrl-${COMPONENT}:osctrl-${COMPONENT} -R /opt/osctrl

COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH}.bin /opt/osctrl/bin/osctrl-${COMPONENT}
COPY osctrl-${COMPONENT}-${GOOS}-${GOARCH} /opt/osctrl/bin/osctrl-${COMPONENT}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Dockerfile now copies a binary without the .bin suffix, but the repo’s existing GitHub composite action that builds Docker images prepares the context with osctrl-${component}-${GOOS}-${GOARCH}.bin (see .github/actions/build/docker/action.yml:50-52). Unless that workflow has been retired, this change will make those Docker builds fail. Consider keeping compatibility (e.g., make the suffix configurable via a build-arg) or update the CI action(s) in the same PR.

Copilot uses AI. Check for mistakes.
Comment thread .goreleaser.yml
Comment on lines 128 to +134
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--platform=linux/arm64"
extra_files:
- osctrl-tls-linux-amd64
- osctrl-tls-linux-arm64
- dist/osctrl-tls-linux-amd64
- dist/osctrl-tls-linux-arm64
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Docker images are configured to build multi-platform via buildx (--platform=linux/amd64 and --platform=linux/arm64), but the Dockerfiles select the binary using GOOS/GOARCH args (defaulting to linux/amd64). GoReleaser isn’t passing per-platform build args here, so the arm64 image will likely embed the amd64 binary. Prefer using buildx-provided TARGETOS/TARGETARCH in the Dockerfiles (or split into per-arch docker entries) so each platform copies the correct artifact.

Copilot uses AI. Check for mistakes.
Comment thread .goreleaser.yml
Comment on lines 140 to +146
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--platform=linux/arm64"
extra_files:
- osctrl-admin-linux-amd64
- osctrl-admin-linux-arm64
- dist/osctrl-admin-linux-amd64
- dist/osctrl-admin-linux-arm64
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Docker images are configured to build multi-platform via buildx (--platform=linux/amd64 and --platform=linux/arm64), but the Dockerfiles select the binary using GOOS/GOARCH args (defaulting to linux/amd64). GoReleaser isn’t passing per-platform build args here, so the arm64 image will likely embed the amd64 binary. Prefer using buildx-provided TARGETOS/TARGETARCH in the Dockerfiles (or split into per-arch docker entries) so each platform copies the correct artifact.

Copilot uses AI. Check for mistakes.
Comment thread .goreleaser.yml
Comment on lines 152 to +158
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--platform=linux/arm64"
extra_files:
- osctrl-api-linux-amd64
- osctrl-api-linux-arm64
- dist/osctrl-api-linux-amd64
- dist/osctrl-api-linux-arm64
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Docker images are configured to build multi-platform via buildx (--platform=linux/amd64 and --platform=linux/arm64), but the Dockerfiles select the binary using GOOS/GOARCH args (defaulting to linux/amd64). GoReleaser isn’t passing per-platform build args here, so the arm64 image will likely embed the amd64 binary. Prefer using buildx-provided TARGETOS/TARGETARCH in the Dockerfiles (or split into per-arch docker entries) so each platform copies the correct artifact.

Copilot uses AI. Check for mistakes.
Comment thread .goreleaser.yml
Comment on lines 164 to +170
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--platform=linux/arm64"
extra_files:
- osctrl-cli-linux-amd64
- osctrl-cli-linux-arm64
- dist/osctrl-cli-linux-amd64
- dist/osctrl-cli-linux-arm64
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Docker images are configured to build multi-platform via buildx (--platform=linux/amd64 and --platform=linux/arm64), but the Dockerfiles select the binary using GOOS/GOARCH args (defaulting to linux/amd64). GoReleaser isn’t passing per-platform build args here, so the arm64 image will likely embed the amd64 binary. Prefer using buildx-provided TARGETOS/TARGETARCH in the Dockerfiles (or split into per-arch docker entries) so each platform copies the correct artifact.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 build Building related issues cicd CICD related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants