Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
ARG DOCKER_VERSION=28.5.1

# dind-cleaner
FROM golang:1.25-alpine3.22 AS cleaner

FROM golang:1.25-alpine3.23 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/*

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.25-alpine3.22 AS bbolt
FROM golang:1.25-alpine3.23 AS bbolt
RUN go install go.etcd.io/bbolt/cmd/bbolt@latest

# node-exporter
FROM quay.io/prometheus/node-exporter:v1.9.1 AS node-exporter

# Main
FROM docker:${DOCKER_VERSION}-dind-rootless

FROM docker:28.5.2-dind-rootless
USER root

RUN chown -R $(id -u rootless) /var /run /lib /home /etc/ssl /etc/apk

# Add community for fuse-overlayfs
RUN echo -en "https://dl-cdn.alpinelinux.org/alpine/v$(cut -d'.' -f1,2 /etc/alpine-release)/main\nhttps://dl-cdn.alpinelinux.org/alpine/v$(cut -d'.' -f1,2 /etc/alpine-release)/community" > /etc/apk/repositories \
&& apk upgrade \
Expand All @@ -39,23 +29,17 @@ RUN echo -en "https://dl-cdn.alpinelinux.org/alpine/v$(cut -d'.' -f1,2 /etc/alpi
&& apk add git --no-cache --upgrade \
&& rm /usr/local/bin/vpnkit \
&& rm -rf /var/cache/apk/*

# Backward compatibility with kernels that do not support `iptables-nft`. Check #CR-23033 for details.
RUN update-alternatives --install $(which iptables) iptables $(which iptables-legacy) 10 \
&& update-alternatives --install $(which ip6tables) ip6tables $(which ip6tables-legacy) 10

ENV DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns

COPY --from=node-exporter /bin/node_exporter /bin/
COPY --from=cleaner /usr/local/bin/dind-cleaner /bin/
COPY --from=quay.io/prometheus/node-exporter:v1.10.2 /bin/node_exporter /bin/
COPY --from=bbolt /go/bin/bbolt /bin/

COPY --from=cleaner /usr/local/bin/dind-cleaner /bin/
WORKDIR /dind
ADD . /dind

RUN chown -R $(id -u rootless) /dind
RUN chown -R $(id -u rootless) /var/run

RUN chown -R $(id -u rootless) /etc/ssl && chmod 777 -R /etc/ssl
USER rootless
RUN rm -i -f /var/run && ln -s /run/user/1000 /var/run
Expand Down
2 changes: 1 addition & 1 deletion service.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 3.0.5
version: 3.0.6