-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (29 loc) · 1.17 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
34
35
36
37
38
39
#-------------------
# Download hcloud
#-------------------
FROM alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS builder
# renovate: datasource=github-releases depName=hcloud-cli lookupName=hetznercloud/cli
ARG HCLOUD_VERSION=v1.50.0
ARG TARGETARCH
ARG TARGETOS
ARG TARGETVARIANT
WORKDIR /tmp
RUN apk --no-cache add --upgrade \
curl
RUN IMAGE=hcloud-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}.tar.gz && \
curl -SsL -o ${IMAGE} https://github.com/hetznercloud/cli/releases/download/${HCLOUD_VERSION}/${IMAGE} && \
tar xzf ${IMAGE} hcloud && \
install hcloud /bin && \
rm ${IMAGE} hcloud
#-------------------
# Minimal image
#-------------------
FROM gcr.io/distroless/static-debian12:nonroot@sha256:6ec5aa99dc335666e79dc64e4a6c8b89c33a543a1967f20d360922a80dd21f02 AS hcloud-cli-minimal
COPY --from=builder /bin/hcloud /bin/hcloud
ENTRYPOINT ["/bin/hcloud"]
#-------------------
# Debug image
#-------------------
FROM gcr.io/distroless/static-debian12:debug-nonroot@sha256:9aca3e7de7bddd3f5d5a7192c4f8aeeba770f72bd61186841d47038e5b388daf AS hcloud-cli-debug
COPY --from=builder /bin/hcloud /bin/hcloud
ENTRYPOINT ["/bin/hcloud"]