Skip to content

Commit

Permalink
Setup multistage Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
caflamand committed Mar 26, 2024
1 parent a949bc7 commit ac2b7d7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM golang:alpine3.19
# Stage 1: Build the application
FROM golang:alpine3.19 AS builder

RUN apk add --no-cache \
git

RUN git clone \
--depth 1 \
--branch "v0.16.0" \
https://github.com/honeycombio/buildevents /opt/buildevents \
RUN apk add --no-cache git \
&& git clone --depth 1 --branch "v0.16.0" https://github.com/honeycombio/buildevents /opt/buildevents \
&& cd /opt/buildevents \
&& go install github.com/honeycombio/buildevents/
&& go install github.com/honeycombio/buildevents/ \
&& apk del git

# Stage 2: Create the final Docker image
FROM alpine:3.19

RUN apk del \
git
COPY --from=builder /go/bin/buildevents /usr/local/bin/buildevents

ENTRYPOINT ["buildevents"]

0 comments on commit ac2b7d7

Please sign in to comment.