...
1# syntax=docker/dockerfile:1
2
3# ENGINE_VERSION is the version of the (docker-in-docker) Docker Engine to
4# test against.
5ARG ENGINE_VERSION=25.0
6
7FROM docker:${ENGINE_VERSION}-dind
8
9# the openssh-client update is needed for security reasons when using docker:23.0-dind, currently maintained as an lts by mirantis
10RUN apk --no-cache upgrade openssh-client && \
11 apk --no-cache add shadow openssh-server && \
12 # TODO(krissetto): `groupadd` can be removed once we only test against moby >= v24
13 # see https://github.com/docker-library/docker/pull/470
14 groupadd -f docker && \
15 useradd --create-home --shell /bin/sh --password $(head -c32 /dev/urandom | base64) penguin && \
16 usermod -aG docker penguin && \
17 ssh-keygen -A
18# workaround: ssh session excludes /usr/local/bin from $PATH
19RUN ln -s /usr/local/bin/docker /usr/bin/docker
20COPY ./connhelper-ssh/entrypoint.sh /
21EXPOSE 22
22ENTRYPOINT ["/entrypoint.sh"]
23# usage: docker run --privileged -e TEST_CONNHELPER_SSH_ID_RSA_PUB=$(cat ~/.ssh/id_rsa.pub) -p 22 $THIS_IMAGE
View as plain text