Skip to content

Commit

Permalink
fix: generalise Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
attributeerror committed Nov 17, 2023
1 parent 060e04b commit 4e7d06e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ RUN go mod download

COPY ./ ./

RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-s -w' -trimpath -o /dist/currency-rates-cronjob
RUN ldd /dist/currency-rates-cronjob | tr -s [:blank:] '\n' | grep ^/ | xargs -I % install -D % /dist/%
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-s -w' -trimpath -o /dist/app
RUN ldd /dist/app | tr -s [:blank:] '\n' | grep ^/ | xargs -I % install -D % /dist/%
RUN ln -s ld-musl-x86_64.so.1 /dist/lib/libc.musl-x86_64.so.1

FROM scratch AS runner

COPY --from=builder /dist /

ENTRYPOINT [ "/currency-rates-cronjob" ]
ENTRYPOINT [ "/app" ]

0 comments on commit 4e7d06e

Please sign in to comment.