question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker tag is munged

See original GitHub issue

Description:

I’m deploying an imaged based lambda function and specify the tag using the appropriate metadata in my template.yaml:

      DockerTag: v1
      DockerContext: ./function
      Dockerfile: Dockerfile

When this image is built using sam build, the docker image created adheres to the following name:

% docker images
REPOSITORY                                                TAG                     IMAGE ID            CREATED         SIZE
process                                                         v1                        4d8ff64bb5b8   20 hours ago   3.13GB

However, when sam deploy --guided is invoked, the following image name is used:

 % docker images
REPOSITORY                                                                                              TAG                                           IMAGE ID            CREATED        
  SIZE
8xxxxxxxxxx4.dkr.ecr.us-east-1.amazonaws.com/dev-scrb-process   process-4d8ff64bb5b8-v1   4d8ff64bb5b8   20 hours ago   3.13GB
process                                                         v1                        4d8ff64bb5b8   20 hours ago   3.13GB

Steps to reproduce:

Create a Docker image function to deploy with the metadata mentioned above.

Observed result:

See Description.

Expected result:

Shouldn’t the image push be: 8xxxxxxxxxx4.dkr.ecr.us-east-1.amazonaws.com/dev-scrb-process:v1 (which is what I was expecting? Why is the function name and another identifier prefix included in the image tag?

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: MacOS
  2. SAM CLI, version 1.16.0
  3. AWS region: us-east-1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jfusscommented, Feb 9, 2021

@xirkus No worries. They are slightly related but one is for the SAM Spec vs the CLI.

In regards to your issue, this behavior is by design. When we upload to ECR, we add extra data to all different functions to be in the same ECR repo. We also add part of the sha (the “other identifier”) to the tag to allow redeployment on Lambda. Otherwise the image is the “same” and Lambda will not get updates.

Closing as this is by design.

0reactions
EvgeniGordeevcommented, Nov 12, 2021

@jfuss Are there plans to give more control over the tag creation to end users? e.g. if one deploys the same code to 5 different environments why to create 5 different images in ECR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker tag
docker tag : An image name is made up of slash-separated name components, optionally prefixed by a registry hostname. The hostname must comply...
Read more >
Dockerfile Cheat Sheet - Kapeli
The builder returns an error if it cannot match the tag value. ... The exec form makes it possible to avoid shell string...
Read more >
biocontainers/perl-data-munge - Quay.io
The selected Dockerfile contains a FROM that refers to private repository . A robot account with read access to that repository is required...
Read more >
What's Wrong With The Docker :latest Tag? - vsupalov.com
Frequent issues and misconceptions around Docker's most used image tag.
Read more >
Slurm github
The obsolete content for the original page can Learn how to build, configure and install ... --wrap "echo hello world". com:xtreme-d/docker-slurm-cluster.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found