fix DOCKERFILE
Some checks failed
dev test / test (push) Successful in 6s
dev test / vulnCheck (push) Successful in 27s
dev test / Ci-Lint (push) Failing after 9s
${{ github.actor }} executed Build Push Prod / build (push) Failing after 37s
${{ github.actor }} executed Build Push Prod / deploy (push) Has been skipped
Some checks failed
dev test / test (push) Successful in 6s
dev test / vulnCheck (push) Successful in 27s
dev test / Ci-Lint (push) Failing after 9s
${{ github.actor }} executed Build Push Prod / build (push) Failing after 37s
${{ github.actor }} executed Build Push Prod / deploy (push) Has been skipped
This commit is contained in:
parent
d22487f9cd
commit
e9a9fb1ddc
23
Dockerfile
23
Dockerfile
@ -1,9 +1,18 @@
|
||||
FROM debian:unstable-slim
|
||||
ARG BINAME=us-dop-api-linux-arm64-0.0.0_1
|
||||
RUN mkdir /app
|
||||
COPY ./assets/ /app/assets/
|
||||
|
||||
COPY ./bin/${BINAME} /usr/bin/us-dop-api
|
||||
|
||||
FROM golang:alpine AS builder
|
||||
ARG TARGETARCH
|
||||
ARG version=not-set
|
||||
ARG SHORTSHA=not-set
|
||||
WORKDIR /app
|
||||
CMD ["us-dop-api"]
|
||||
COPY . .
|
||||
# https://stackoverflow.com/questions/70369368/check-architecture-in-dockerfile-to-get-amd-arm
|
||||
RUN go build -o bin/us-dop-api \
|
||||
-ldflags "-X main.Shortsha=${SHORTSHA} \
|
||||
-X main.Version=${version} \
|
||||
-X main.Aarch=${TARGETARCH}" ./cmd
|
||||
|
||||
FROM alpine AS runner
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/bin/us-dop-api /usr/bin/
|
||||
COPY --from=builder /app/assets/ /app/assets/
|
||||
ENTRYPOINT /usr/bin/us-dop-api
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user