Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lsowen committed Sep 15, 2024
1 parent 943c9a9 commit b4504d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@ jobs:
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/#-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/#-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Build the binary
FROM golang:1.22 AS builder

WORKDIR /workspace
WORKDIR /build

COPY ./ /workspace/
COPY go.mod go.sum ./
RUN go mod download

COPY ./ ./


# Build
RUN CGO_ENABLED=0 go build -o hoover-dam ./cmd/hooverdam
Expand All @@ -14,7 +16,7 @@ RUN CGO_ENABLED=0 go build -o hoover-dam ./cmd/hooverdam
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot@sha256:42d15c647a762d3ce3a67eab394220f5268915d6ddba9006871e16e4698c3a24
COPY --from=builder /workspace/hoover-dam /usr/local/bin/
COPY --from=builder /build/hoover-dam /usr/local/bin/

USER 65532:65532

Expand Down

0 comments on commit b4504d3

Please # to comment.