Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check manifest before attempting to push docker images #15093

Merged
merged 7 commits into from
Aug 1, 2022

Conversation

logand22
Copy link
Contributor

@logand22 logand22 commented Aug 1, 2022

This PR updates the publishing of images to Amazon ECR to first check if the image exists before attempting to push to it.

Testing

➜  teleport git:(logan/reentrable-docker-push-amazon-ecr) ✗ export DOCKER_IMAGE_STAGING=146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:10.1.2
➜  teleport git:(logan/reentrable-docker-push-amazon-ecr) ✗ if docker manifest inspect ${DOCKER_IMAGE_STAGING} 2>&1 >/dev/null; then echo "Image already exists"; else echo "Push new image"; fi
no such manifest: 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:10.1.2
Push new image
➜  teleport git:(logan/reentrable-docker-push-amazon-ecr) ✗ export DOCKER_IMAGE_STAGING=146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:10.1.1
➜  teleport git:(logan/reentrable-docker-push-amazon-ecr) ✗ if docker manifest inspect ${DOCKER_IMAGE_STAGING} 2>&1 >/dev/null; then echo "Image already exists"; else echo "Push new image"; fi
Image already exists

Drone build showing it passes with existing images: https://drone.platform.teleport.sh/gravitational/teleport/14212

@github-actions github-actions bot requested review from r0mant and tigrato August 1, 2022 19:02
Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this on CI?

@github-actions github-actions bot removed the request for review from tigrato August 1, 2022 21:16
@logand22 logand22 merged commit 0a0eb9d into master Aug 1, 2022
@zmb3 zmb3 deleted the logan/reentrable-docker-push-amazon-ecr branch September 9, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants