Add e2e test for authorized pull/push
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
#!/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}"
Can I start working on it?
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!
Yes, feel free to open a PR