cli icon indicating copy to clipboard operation
cli copied to clipboard

Add e2e test for authorized pull/push

Open vvoland opened this issue 9 months ago โ€ข 2 comments

Description

We need an e2e test that verifies that docker pull/push works for private repositories.

This would serve as an regression test for: https://github.com/docker/cli/issues/5963

vvoland avatar Mar 25 '25 15:03 vvoland

#!/bin/bash

Configuration (replace with real values or use env vars)

DOCKER_REGISTRY="your-registry.com" DOCKER_USERNAME="your-username" DOCKER_PASSWORD="your-password" IMAGE_NAME="private-image-e2e-test" TAG="v1" FULL_IMAGE="${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${TAG}"

set -e # Exit immediately on error

echo "๐Ÿ” Logging in to Docker registry..." echo "${DOCKER_PASSWORD}" | docker login "${DOCKER_REGISTRY}" -u "${DOCKER_USERNAME}" --password-stdin

echo "๐Ÿณ Creating a test image..." echo -e "FROM alpine\nCMD echo Hello from e2e test!" > Dockerfile docker build -t "${FULL_IMAGE}" .

echo "๐Ÿ“ค Pushing the image to private registry..." docker push "${FULL_IMAGE}"

echo "๐Ÿงน Removing local image to simulate pull..." docker rmi "${FULL_IMAGE}"

echo "๐Ÿ“ฅ Pulling the image from registry..." docker pull "${FULL_IMAGE}"

echo "๐Ÿš€ Running the pulled image..." docker run --rm "${FULL_IMAGE}"

echo "โœ… e2e test passed: push and pull successful!"

Optional cleanup

docker rmi "${FULL_IMAGE}"

docker logout "${DOCKER_REGISTRY}"

RASHMIBB23 avatar Apr 10 '25 07:04 RASHMIBB23

Can I start working on it?

Antraxmin avatar Apr 29 '25 01:04 Antraxmin

Hey @Benehiko,

I'm interested in working on this issue. Is it still available for contributions? Let me know if I can get assigned to it!

Thanks!

AryanSharma9917 avatar Jul 17 '25 16:07 AryanSharma9917

Yes, feel free to open a PR

vvoland avatar Jul 17 '25 18:07 vvoland