forked from codefresh-io/dind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (28 loc) · 1.21 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
40
ARG DOCKER_VERSION=24.0.5
# dind-cleaner
FROM golang:1.21-alpine3.18 AS cleaner
COPY cleaner/dind-cleaner/* /go/src/github.com/codefresh-io/dind-cleaner/
WORKDIR /go/src/github.com/codefresh-io/dind-cleaner/
RUN go mod tidy
COPY cleaner/dind-cleaner/cmd ./cmd/
RUN CGO_ENABLED=0 go build -o /usr/local/bin/dind-cleaner ./cmd && \
chmod +x /usr/local/bin/dind-cleaner && \
rm -rf /go/*
# bbolt
FROM golang:1.21-alpine3.18 AS bbolt
RUN go install go.etcd.io/bbolt/cmd/bbolt@latest
# node-exporter
FROM quay.io/prometheus/node-exporter:v1.6.1 AS node-exporter
# Main
FROM docker:${DOCKER_VERSION}-dind
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories \
&& apk upgrade \
# Add fuse-overlayfs for comaptibility with rootless. Volumes created with rootless might use fuse-overlay formatted volumes. If those volumes are later used by dind that runs with root it'll require fuse-overlay to be able to read the volume
&& apk add bash fuse-overlayfs jq --no-cache \
&& rm -rf /var/cache/apk/*
COPY --from=node-exporter /bin/node_exporter /bin/
COPY --from=cleaner /usr/local/bin/dind-cleaner /bin/
COPY --from=bbolt /go/bin/bbolt /bin/
WORKDIR /dind
ADD . /dind
ENTRYPOINT ["./run.sh"]