-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (31 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM curlimages/curl as downloader-task
ARG TASK_VERSION=3.35.1
ARG TARGETARCH
WORKDIR /download
RUN curl --retry 6 -Ls https://github.com/go-task/task/releases/download/v${TASK_VERSION}/task_linux_${TARGETARCH}.tar.gz | tar -xz -C /download/ \
&& chmod +x /download/task
# -------------------------------------
# builder
# -------------------------------------
FROM golang:1.22-alpine3.18 as builder
RUN apk add --update --no-cache \
bash \
build-base
# install task
COPY --from=downloader-task /download/task /usr/local/bin/task
WORKDIR /build
# cache dependencies (for faster builds)
COPY go.* ./
RUN go mod download
# build
COPY . .
RUN task build
FROM alpine:3 as builder-ssl-certs
RUN apk add --no-cache ca-certificates
# -------------------------------------
# prod
# -------------------------------------
FROM scratch as prod
COPY --from=builder-ssl-certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/bin/chia-price-exporter /usr/local/bin/chia-price-exporter
ENTRYPOINT ["/usr/local/bin/chia-price-exporter"]