File: Dockerfile.connhelper-ssh

package info (click to toggle)
docker.io 27.5.1%2Bdfsg4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 67,384 kB
  • sloc: sh: 5,847; makefile: 1,146; ansic: 664; python: 162; asm: 133
file content (23 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# syntax=docker/dockerfile:1

# ENGINE_VERSION is the version of the (docker-in-docker) Docker Engine to
# test against.
ARG ENGINE_VERSION=26.1

FROM docker:${ENGINE_VERSION}-dind

# the openssh-client update is needed for security reasons when using docker:23.0-dind, currently maintained as an lts by mirantis
RUN apk --no-cache upgrade openssh-client && \
  apk --no-cache add shadow openssh-server && \
  # TODO(krissetto): `groupadd` can be removed once we only test against moby >= v24
  # see https://github.com/docker-library/docker/pull/470
  groupadd -f docker && \
  useradd --create-home --shell /bin/sh --password $(head -c32 /dev/urandom | base64) penguin && \
  usermod -aG docker penguin && \
  ssh-keygen -A
# workaround: ssh session excludes /usr/local/bin from $PATH
RUN  ln -s /usr/local/bin/docker /usr/bin/docker
COPY ./connhelper-ssh/entrypoint.sh /
EXPOSE 22
ENTRYPOINT ["/entrypoint.sh"]
# usage: docker run --privileged -e TEST_CONNHELPER_SSH_ID_RSA_PUB=$(cat ~/.ssh/id_rsa.pub) -p 22 $THIS_IMAGE