Skip to content

Commit

Permalink
simplified Dockerfile, we no longer need to recompile binary
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmittag committed Dec 4, 2023
1 parent d9bcb3c commit 6443e69
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# This is multiarch including linux/amd64 and linux/arm64/v8, see: docker buildx imagetools inspect golang:1.21.4-alpine
FROM golang:1.21.4-alpine AS build

FROM alpine
RUN apk update && apk upgrade && apk add --no-cache bash git

WORKDIR .
COPY . /proj/

# now build from source on each platform this Dockerfile gets executed
WORKDIR /proj
RUN CGO_ENABLED=0 go build github.com/simonmittag/j8a/cmd/j8a

# multistage build uses output from previous image
# base image for distro is also multiarch, see: docker buildx imagetools inspect alpine
FROM alpine
COPY --from=build /proj/j8a /j8a
COPY j8a /j8a

ENV LOGLEVEL="DEBUG"

Expand Down

0 comments on commit 6443e69

Please sign in to comment.