devspace icon indicating copy to clipboard operation
devspace copied to clipboard

Multiple entries in the images section with the same image value but different tags

Open azagarelz opened this issue 5 years ago • 4 comments

Is your feature request related to a problem? We would like to use the same ECR repo for different images and differentiate them using a tag. It seems that devspace today doesn't allow that and instead, it throws the following error

[fatal] multiple image definitions with the same image name are not allowed

Example: version: v1beta9 images: a: image: xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/test tags: - a-1.0 b: image: xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/test tags: - b-1.0

Which solution do you suggest? A kind of option that enables to specify a default prefix tag option and concatenate the rest of the tag generated by devspace later

Which alternative solutions exist? Use different repos :)

/kind feature

azagarelz avatar Dec 17 '20 16:12 azagarelz

@azagarelz thanks for reporting this issue! I understand the use case, however how would you reference these images in the deployment section, because this would lead to ambiguous behavior:

images:
  default:
    image: myusername/devspace
    tags: ["a"]
  default2:
    image: myusername/devspace
    tags: ["b"]
deployments:
- name: default
  helm:
    values:
      containers:
      - image: myusername/devspace # <- this is now ambiguous

Since we have now replacement helpers like tag() and image() for deployments, we could think about one that takes the config name of the image instead of the image name and replaces this, which then would work for your use case.

FabianKramm avatar Dec 18 '20 10:12 FabianKramm

@FabianKramm having a helper that takes the image config name would be great!

azagarelz avatar Dec 18 '20 11:12 azagarelz

Any updates on this? I'm in the same situation where I have a Dockerfile target to build and serve assets and another one with the application itself. Those are currently separated using tags.

emoreth avatar Aug 17 '21 21:08 emoreth

If someone still needs a fix, you can rebuild the binary as I've described in another issue https://github.com/devspace-sh/devspace/issues/886#issuecomment-1804679336

alexrimlin avatar Nov 09 '23 21:11 alexrimlin