ansible-container icon indicating copy to clipboard operation
ansible-container copied to clipboard

Do not force to set a namespace

Open alexppg opened this issue 7 years ago • 2 comments

ISSUE TYPE
  • Feature Idea
container.yml
version: '2'
settings:
  conductor_base: centos:7
  project_name  : meh

registries:
  aws:
    url: https://asdasdasdas.dkr.ecr.eu-west-1.amazonaws.com/
    namespace: base
    repository_prefix: ""

services:
  base:
    from        : centos:7
    command     :
      - /bin/bash
      - -c
      - sleep infinity

    roles:
      - do-stuff
SUMMARY

When pushing to a registry, ansible-container gets the registry name and automatically constructs the url like:

{{ registries.{{ name }}.url }}/{{ namespace }}/{{ services.{{ name }} }}

Or, following the above config:

684730133717.dkr.ecr.eu-west-1.amazonaws.com/base/base

On registries like the AWS one, there's no namespace. When setting namespace to "" like the repository_prefix, then the repository_prefix will be the project_name. So if still there's not a method to set namespace to a null value, it would be awesome to do so.

alexppg avatar Sep 25 '17 12:09 alexppg

actually AWS ECR has namespace design with optionally.

chrisLeeTW avatar Oct 29 '17 05:10 chrisLeeTW

from aws ecr create-repository help:

       --repository-name (string)
          The name to use for the repository. The repository name may be spec-
          ified on its own (such as nginx-web-app ) or  it  can  be  prepended
          with  a  namespace  to group the repository into a category (such as
          project-a/nginx-web-app ).

note the value.

mvk avatar Jan 30 '18 14:01 mvk