Skip to content

Commit

Permalink
chore: fix and optimize image
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarabas committed Apr 19, 2024
1 parent d3d61e7 commit dd24402
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
FROM ubuntu:jammy

ENV GOPATH /go

RUN apt update && \
apt install -y golang && \
apt-get purge -y --auto-remove

COPY go.mod .
COPY go.sum .

RUN GO11MODULE=on go mod download

FROM golang:alpine AS build
COPY . .

RUN GO11MODULE=on go mod download
RUN go build -tags=release -buildvcs=false .

FROM ubuntu:jammy

RUN apt update && \
apt install -y curl && \
apt-get purge -y --auto-remove

FROM golang:alpine
RUN apk add --no-cache curl
COPY --from=build /go/fly-exporter /fly-exporter
ENTRYPOINT [ "/fly-exporter" ]

0 comments on commit dd24402

Please sign in to comment.