teluzia.Cloud Engineer · Day 104
CHAPTER 15 · DOCKER AND CONTAINERS

ECR, image scanning and containerized app project

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

A registry is the artifact warehouse; scanning is an inspection report about known issues in its contents, not a guarantee of harmless operation. ECR stores container images in repositories. Push and pull require appropriate IAM actions and registry authentication. Authentication tokens are temporary; use supported credential mechanisms and least privilege. A repository URI identifies the account, region, repository, and tag or digest, not a running deployment. Tags can move, while digests identify image content. Scan findings depend on scanning mode, coverage, vulnerability data, and time; review severity and applicability rather than assume no reported issue means no risk. Rebuild and patch dependencies with evidence, not by changing the tag name alone.

Think of it this way

A registry is the artifact warehouse; scanning is an inspection report about known issues in its contents, not a guarantee of harmless operation.

TOPIC 01 / 03Step by step

ECR repository and authentication

ECR stores container images in repositories. Push and pull require appropriate IAM actions and registry authentication. Authentication tokens are temporary; use supported credential mechanisms and least privilege. A repository URI identifies the account, region, repository, and tag or digest, not a running deployment. For example, a pipeline pushes an image to one ECR repository, while a workload role receives only the pull permissions it needs.

WORKED EXAMPLE
A pipeline pushes an image to one ECR repository, while a workload role receives only the pull permissions it needs.

A pipeline obtains temporary AWS credentials with permission for one ECR repository. It then authenticates the Docker client to the appropriate account-and-region registry using the supported token flow. Tagging an existing local image with that repository URI names the push destination; pushing uploads the artifact. None of these steps starts an application instance.

A registry stores image artifacts. A repository groups related images. Authentication proves a client identity or token, while authorization controls allowed actions. A workload that pulls images needs a different permission scope from a publisher. Check account, region, repository, and credential lifetime when push or pull fails. Avoid printing login passwords or embedding cloud credentials in a Dockerfile. Publication enables later deployment, but release automation must separately update its runtime platform and validate health. A successfully pushed artifact can still have incorrect configuration, incompatible architecture, or an application that exits immediately.

Why this matters

A pipeline pushes an image to one ECR repository, while a workload role receives only the pull permissions it needs.

A common trap

Do not overlook this operational distinction: A repository URI identifies the account, region, repository, and tag or digest, not a running deployment.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

ECR repository and authentication

ECR stores container images in repositories. Push and pull require appropriate IAM actions and registry authentication. Authentication tokens are temporary; use supported credential mechanisms and least privilege. A repository URI identifies the account, region, repository, and tag or digest, not a running deployment. For example, a pipeline pushes an image to one ECR repository, while a workload role receives only the pull permissions it needs.

WORKED EXAMPLE
A pipeline pushes an image to one ECR repository, while a workload role receives only the pull permissions it needs.

A pipeline obtains temporary AWS credentials with permission for one ECR repository. It then authenticates the Docker client to the appropriate account-and-region registry using the supported token flow. Tagging an existing local image with that repository URI names the push destination; pushing uploads the artifact. None of these steps starts an application instance.

A registry stores image artifacts. A repository groups related images. Authentication proves a client identity or token, while authorization controls allowed actions. A workload that pulls images needs a different permission scope from a publisher. Check account, region, repository, and credential lifetime when push or pull fails. Avoid printing login passwords or embedding cloud credentials in a Dockerfile. Publication enables later deployment, but release automation must separately update its runtime platform and validate health. A successfully pushed artifact can still have incorrect configuration, incompatible architecture, or an application that exits immediately.

Why this matters

A pipeline pushes an image to one ECR repository, while a workload role receives only the pull permissions it needs.

A common trap

Do not overlook this operational distinction: A repository URI identifies the account, region, repository, and tag or digest, not a running deployment.

Image identity and scanning

Tags can move, while digests identify image content. Scan findings depend on scanning mode, coverage, vulnerability data, and time; review severity and applicability rather than assume no reported issue means no risk. Rebuild and patch dependencies with evidence, not by changing the tag name alone. For example, deploy a reviewed image digest and record the scan result for that artifact rather than an ambiguous mutable latest tag.

WORKED EXAMPLE
Deploy a reviewed image digest and record the scan result for that artifact rather than an ambiguous mutable latest tag.

A team scans an image tagged release and later moves that tag to another build. The old scan report no longer proves anything about the new content. Capture the digest of the scanned artifact and compare it with the deployed digest. Findings also evolve as vulnerability databases and scanning coverage change, even when the artifact bytes stay identical.

A tag is a mutable reference unless repository policy constrains it. A digest identifies content. A finding reports a known issue according to the configured scanning mode and available data. Basic and enhanced scanning have different capabilities and dependencies, so check the chosen setup. No findings is not proof of zero risk. Evaluate package, affected version, severity, exploitability context, and remediation. Rebuild from patched inputs, rescan the new artifact, and verify that the intended runtime actually deploys that content instead of merely renaming an old image.

Why this matters

Deploy a reviewed image digest and record the scan result for that artifact rather than an ambiguous mutable latest tag.

A common trap

Do not overlook this operational distinction: Rebuild and patch dependencies with evidence, not by changing the tag name alone.

Containerized project validation

A container project should prove build, runtime behavior, configuration, network access, persistent data expectations, and cleanup. Registry permissions and runtime identity are separate. Keep credentials outside the image and document expected health behavior before connecting the deployment to user traffic. For example, a local HTTP check passes before a controlled push; the README separately records future ECR authentication and workload pull access.

WORKED EXAMPLE
A local HTTP check passes before a controlled push; the README separately records future ECR authentication and workload pull access.

A container project first passes a local behavior test, then receives a release record with source revision, image digest, configuration requirements, and expected health checks. Registry publication and deployment are separate milestones. When the runtime starts, validate image retrieval, process behavior, required network paths, and data persistence under the intended identity.

An acceptance check establishes a required user-visible behavior. Runtime identity controls service access while the process runs. Provenance links the artifact to its build source and inputs. Avoid secrets in the image because everyone authorized to retrieve the artifact may inspect its layers. Local success provides useful evidence but does not establish ECR authorization or cloud data access. Write those checks explicitly and mark unexecuted ones honestly. Teardown should cover runtime resources and retained registry artifacts according to ownership and retention requirements, rather than assume deleting a container removes its published image or all supporting infrastructure.

Why this matters

A local HTTP check passes before a controlled push; the README separately records future ECR authentication and workload pull access.

A common trap

Do not overlook this operational distinction: Keep credentials outside the image and document expected health behavior before connecting the deployment to user traffic.

KEEP THESE WITH YOU

Today’s takeaways

ECR repository and authentication: ECR stores container images in repositories. Push and pull require appropriate IAM actions and registry authentication. Authentication tokens are temporary; use supported credential mechanisms and least privilege. A repository URI identifies the account, region, repository, and tag or digest, not a running deployment.

Image identity and scanning: Tags can move, while digests identify image content. Scan findings depend on scanning mode, coverage, vulnerability data, and time; review severity and applicability rather than assume no reported issue means no risk. Rebuild and patch dependencies with evidence, not by changing the tag name alone.

Containerized project validation: A container project should prove build, runtime behavior, configuration, network access, persistent data expectations, and cleanup. Registry permissions and runtime identity are separate. Keep credentials outside the image and document expected health behavior before connecting the deployment to user traffic.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed