devops329 / devops

BYU CS 329: QA & DevOps
MIT License
5 stars 18 forks source link

Update awsEcr.md Provide Provenance flag to avoid "three artifact" behavior #90

Closed frozenfrank closed 3 weeks ago

frozenfrank commented 4 weeks ago

Overview

Provide and document the --provenance=false flag which avoids future confusion.

Discussion

By default, on at least some systems, following the recommended procedures results in multiple artifacts being upload the AWS ECR for a single push event. These are harmless and don't cause any problems, but they are confusing. This behavior was observed by myself and multiple other students.

Screenshot

A screenshot originally posted by Harrison Casper showing the downstream behavior that occurs without this flag. image

Credit

The solution was originally shared with the class by Seth Ramer, who posted about it in Discord.

leesjensen commented 3 weeks ago

This is interesting. It seems to be related to when you build multi-arch container images. The instruction doesn't tell you to do that does it?

Was your container built with

docker build  --platform=linux/arm64 -t jwt-pizza-service .

As given in the instruction, or was the buildx command used?

frozenfrank commented 3 weeks ago

@leesjensen Out of curiosity mostly, I followed the instructions exactly as defined in the instruction. It lead to the triple entries. The --provenance=false flag removes avoid the additional entries.

Screenshots

AWS ECR Before

Screenshot 2024-11-06 at 2 31 39 AM

Commands Run

Screenshot 2024-11-06 at 2 36 03 AM

AWS ECR After

(Notice the additional entries.) Screenshot 2024-11-06 at 2 32 31 AM