Skip to content

Commit

Permalink
fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Nov 29, 2023
1 parent 0fe3389 commit 71dceb2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ COPY . .
ARG TARGETOS
ARG TARGETARCH
ARG release=
RUN <<EOR
VERSION=$(git rev-parse --short HEAD)
BUILDTIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
RELEASE=$release
CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /bin/ -ldflags="-s -w -X 'github.com/pk910/dora/utils.BuildVersion=${VERSION}' -X 'github.com/pk910/dora/utils.BuildRelease=${RELEASE}' -X 'github.com/pk910/dora/utils.Buildtime=${BUILDTIME}'" ./cmd/*
EOR
RUN make build RELEASE=$release GOOS=$TARGETOS GOARCH=$TARGETARCH

# final stage
FROM debian:stable-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN update-ca-certificates
COPY --from=build-env /bin/* /app
COPY --from=build-env /src/bin /app
EXPOSE 8080
ENTRYPOINT ["./dora-explorer"]
CMD []

0 comments on commit 71dceb2

Please sign in to comment.