Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Multiple tags does not work as expected #49

Open
petracvv opened this issue Apr 20, 2023 · 0 comments
Open

[BUG] Multiple tags does not work as expected #49

petracvv opened this issue Apr 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@petracvv
Copy link

Version

The version of the action I am using is redhat-actions/s2i-build@v2

Describe the bug

When using the tags functionality of the action (i.e. supplying tags to the action) and having more than one tag specified and separated by spaces, the action fails. This is due to the fact that the underlying docker command it uses (docker tag) can only add one tag per call and not multiple tags.

Steps to reproduce, workflow links, screenshots

You can reproduce this by creating a workflow that utilizes the multiple tagging feature.
Something like the example workflow in the README should work:

steps:
  env:
    IMAGE_NAME: myproject/myimage
    TAGS: latest v1.0.0 ${{ github.sha }}

  - name: Checkout
    uses: actions/checkout@v2

  # Setup S2i and Build container image
  - name: Setup and Build
    id: build_image
    uses: redhat-actions/s2i-build@v2
    with:
      path_context: '.'
      # Builder image for a java project
      builder_image: 'registry.access.redhat.com/openjdk/openjdk-11-rhel7'
      image: ${{ env.IMAGE_NAME }}
      tags: ${{ env.TAGS }}

The image will be built, but the action will fail at the tagging stage.
An example of the output (image names redacted):

Tagging the built image with tags latest, v1.0.0 and 9ef2acd0a5de8356cce01758d657f4cba43458e9
/usr/bin/docker tag myproject/myimage:latest myproject/myimage:v1.0.0 myproject/myimage:9ef2acd0a5de8356cce01758d657f4cba43458e9
"docker tag" requires exactly 2 arguments.
See 'docker tag --help'.

Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
Error: Error: docker exited with code 1
"docker tag" requires exactly 2 arguments.
See 'docker tag --help'.

Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
@petracvv petracvv added the bug Something isn't working label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant