mirror of
https://github.com/docker/cli.git
synced 2026-08-24 02:24:17 -05:00
This adds an e2e regression test for authenticated pull/push against a private registry, covering the auth regression reported in docker/cli#5963. Includes: - New privateregistry service in the e2e Compose stack with htpasswd auth on port 5001, and --insecure-registry for the engine container. - TestPullPushPrivateRepository test that verifies authenticated push/pull and rejects unauthenticated operations. - Auth config and test credentials in e2e/testdata/registry/. - 90-second retry loop for transient DNS/container startup races. - Service health wait loop in scripts/test/e2e/run. - Increase TestProcessTermination timeout from 10s to 20s for connhelper-ssh + engine 25 combination. - Connhelper-ssh engine Dockerfile for private registry integration. Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
24 lines
1.1 KiB
Docker
24 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# ENGINE_VERSION is the version of the (docker-in-docker) Docker Engine to
|
|
# test against.
|
|
ARG ENGINE_VERSION=29
|
|
|
|
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 add openssl openssh-client openssh-server shadow && \
|
|
apk --no-cache upgrade openssl openssh-client openssh-server && \
|
|
useradd --create-home --shell /bin/sh --password $(head -c32 /dev/urandom | base64) penguin && \
|
|
usermod -aG docker penguin && \
|
|
ssh-keygen -A
|
|
# Trust the tlsregistry CA so dockerd connects without --insecure-registry.
|
|
COPY registry/certs/ca.crt /usr/local/share/ca-certificates/tlsregistry-ca.crt
|
|
RUN update-ca-certificates
|
|
# 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
|