Tagging custom tag for docker image at ECR

Hi
I am unable to create custom tags for the docker image. I can tag only the latest. But also want to tag Eg: offers,rec to image

put: ecr-docker-reg-dev
params:
build: NeXus
dockerfile: NeXus/Dockerfile.dev
build_args:
AWS_ACCESS_KEY_ID: ((aws_dev.aws_access_key_id))
AWS_SECRET_ACCESS_KEY: ((aws_dev.aws_secret_access_key))
DJANGO_SETTINGS_MODULE: nexus.settings.dev.settings
NEXUS_ENV: dev
tag_as_latest: true
tag_file: NeXus/.git/ref

I am trying to add

tag: offers

tag: offers

It’s not working

Based on the docker-image resource docs the tag parameter is deprecated in favour of the tag_file option. You might be able to have more than one tag in the tag_file but I’m not sure about that.

1 Like

I want to tag offer for docker image. Any Idea how to tag offers to docker file.

Fixed it by adding task in job

  serial: true
  serial_groups: [version]
  plan:
  - get: NeXus
    trigger: true
  - task: generate-tag
    params:
      TAG: offers
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: ruby
      outputs:
        - name: tag-file
      params:
        TAG:
      run:
        path: /bin/bash
        args:
          - -c
          - |
            echo "${TAG}" >> tag-file/tag.txt
  - put: ecr-docker-reg-dev
    params:
      build: NeXus
      dockerfile: NeXus/Dockerfile.dev
      tag_as_latest: true
      tag: tag-file/tag.txt
      force: true
      tag_only: true