-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (25 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
39 lines (25 loc) · 1.18 KB
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
34
35
36
37
38
39
# ─── BUILDER STAGE ───────────────────────────────────────────────────────────────
FROM golang:1.26-alpine AS builder
ARG HEIMDALL_DIR=/var/lib/heimdall/
ENV HEIMDALL_DIR=${HEIMDALL_DIR}
RUN apk add --no-cache build-base git linux-headers
WORKDIR ${HEIMDALL_DIR}
COPY go.mod go.sum ./
RUN --mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
RUN --mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make build
# ─── RUNTIME STAGE ────────────────────────────────────────────────────────────────
FROM alpine:3.23
ARG HEIMDALL_DIR=/var/lib/heimdall/
ENV HEIMDALL_DIR=${HEIMDALL_DIR}
RUN apk add --no-cache bash ca-certificates && \
mkdir -p ${HEIMDALL_DIR}
WORKDIR ${HEIMDALL_DIR}
COPY --from=builder ${HEIMDALL_DIR}/build/heimdalld /usr/local/bin/heimdalld
EXPOSE 1317 26656 26657
ENTRYPOINT ["/usr/local/bin/heimdalld"]