Skip to content

Commit

Permalink
Fix image builds (#20)
Browse files Browse the repository at this point in the history
Fixes image builds due to missing binary

Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
Co-authored-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
  • Loading branch information
tylerauerbeck and tylerauerbeck authored Jun 23, 2023
1 parent a9389d1 commit bd4973e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
FROM gcr.io/distroless/static
FROM golang:1.20.5 AS builder

# Copy the binary that goreleaser built
COPY location-api /location-api
COPY . /src
WORKDIR /src

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bin/location-api .

# Pass in name as --build-arg
FROM gcr.io/distroless/static:nonroot
# `nonroot` coming from distroless
USER 65532:65532

COPY --from=builder /src/bin/location-api /location-api

# Run the web service on container startup.
ENTRYPOINT ["/location-api"]
Expand Down

0 comments on commit bd4973e

Please sign in to comment.