Skip to content

chore: harden Dockerfiles and add devops CODEOWNERS#535

Merged
RafilxTenfen merged 2 commits intomainfrom
chore/dockerfile-hardening-and-codeowners
Feb 6, 2026
Merged

chore: harden Dockerfiles and add devops CODEOWNERS#535
RafilxTenfen merged 2 commits intomainfrom
chore/dockerfile-hardening-and-codeowners

Conversation

@mpastecki
Copy link
Contributor

Summary

  • Pin Alpine runtime packages to exact versions (Alpine 3.21)
  • Pin Debian runtime packages to exact versions (bookworm) where applicable
  • Upgrade base images to current stable (Alpine 3.21, Debian bookworm)
  • Apply hadolint best practices: SHELL pipefail, --no-cache/--no-install-recommends, shell variable quoting, merged RUN layers
  • Add CODEOWNERS rules for /.github/, /.github/CODEOWNERS, and **/Dockerfile owned by @babylonlabs-io/devops

Copy link
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 hardens the Dockerfiles by pinning package versions, upgrading base images, and applying hadolint best practices, while also adding CODEOWNERS rules for the DevOps team.

Changes:

  • Upgraded proto/Dockerfile from golang:1.20.5-buster to golang:1.23-bookworm with pinned Debian packages and hadolint best practices (SHELL pipefail, --no-install-recommends, proper cleanup, quoted variables)
  • Updated main Dockerfile to use Alpine 3.21 with pinned runtime package versions (bash, curl, jq) and improved shell variable quoting
  • Added CODEOWNERS rules assigning @babylonlabs-io/devops ownership of .github/, CODEOWNERS file, and all Dockerfiles

Reviewed changes

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

File Description
proto/Dockerfile Upgrades Go version and Debian base image, adds SHELL directive, pins package versions, improves quoting and layer merging
Dockerfile Upgrades Alpine to 3.21, pins runtime packages, improves shell variable quoting, removes redundant cleanup commands
.github/CODEOWNERS Adds DevOps team ownership rules for CI/CD and container configuration files

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

&& go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION}" \
&& go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION}" \
&& go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION}" \
&& go install golang.org/x/tools/cmd/goimports@v0.1.7 \
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

This go install command is missing quotes around the package path with version, which is inconsistent with the quoting pattern applied to lines 31-34 above. For consistency with the hadolint best practice of shell variable quoting being applied throughout this file, this line should be: go install "golang.org/x/tools/cmd/goimports@v0.1.7"

Suggested change
&& go install golang.org/x/tools/cmd/goimports@v0.1.7 \
&& go install "golang.org/x/tools/cmd/goimports@v0.1.7" \

Copilot uses AI. Check for mistakes.

# DevOps team owns CI/CD and container configuration
/.github/ @babylonlabs-io/devops
/.github/CODEOWNERS @babylonlabs-io/devops
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The pattern /.github/CODEOWNERS is redundant because line 7 already specifies /.github/ which covers all files in the .github directory, including CODEOWNERS. This line can be removed for cleaner CODEOWNERS configuration.

Suggested change
/.github/CODEOWNERS @babylonlabs-io/devops

Copilot uses AI. Check for mistakes.
# /make/builder.Dockerfile
# /tools/Dockerfile
FROM golang:1.20.5-buster
FROM golang:1.23-bookworm
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The Go version in this Dockerfile (1.23) is inconsistent with the project's Go version. The main Dockerfile uses golang:1.25-alpine (line 2 of Dockerfile), go.mod specifies go 1.25.0, and .github/workflows/ci.yml uses go-version: '1.25'. This proto Dockerfile should be updated to golang:1.23-bookworm or golang:1.25-bookworm to match the project's Go version.

Suggested change
FROM golang:1.23-bookworm
FROM golang:1.25-bookworm

Copilot uses AI. Check for mistakes.
@RafilxTenfen RafilxTenfen merged commit 7f76a6b into main Feb 6, 2026
6 of 7 checks passed
@RafilxTenfen RafilxTenfen deleted the chore/dockerfile-hardening-and-codeowners branch February 6, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants