us-dop-scrapper/Dockerfile
maximo tejeda e986d8884a
Some checks failed
dev test / test (push) Failing after 52s
dev test / vulnCheck (push) Has been skipped
dev test / Ci-Lint (push) Has been skipped
fix imports
2024-12-02 20:11:31 -04:00

19 lines
546 B
Docker

FROM golang:alpine AS builder
ARG TARGETARCH
ARG version=not-set
ARG SHORTSHA=not-set
WORKDIR /app
COPY . .
ENV GOPRIVATE=git.maximotejeda.com/maximo,github.com/maximotejeda
ENV GOPROXY=direct
# https://stackoverflow.com/questions/70369368/check-architecture-in-dockerfile-to-get-amd-arm
RUN go build -o bin/crawler \
-ldflags "-X main.Shortsha=${SHORTSHA} \
-X main.Version=${version} \
-X main.Aarch=${TARGETARCH}" ./cmd
FROM alpine AS runner
COPY --from=builder /app/bin/crawler /usr/bin/
WORKDIR /app
ENTRYPOINT /usr/bin/crawler