kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

When running multiple destinations it does not seem to work

Open brammittendorff opened this issue 2 years ago • 2 comments

Actual behavior When added multiple destinations as is said it is and multi-arg type. It doesnt accept multilpe destinations/tags.

Version control tool:

Gitlab

Version:

❯ docker run gcr.io/kaniko-project/executor:debug version
Kaniko version :  v1.13.0

Executing:

/kaniko/executor --cache --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/testing.Dockerfile" --destination "${IMAGE_TESTING}:${CI_COMMIT_SHORT_SHA}" --destination "${IMAGE_TESTING}:latest"

Response:

error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: getting tag for destination: repository can only contain the characters `abcdefghijklmnopqrstuvwxyz0123456789_-./`: repo/repo/testing:69e44678

Expected behavior We expect that it would tag our image multiple times testing:69e44678 and testing:latest.

To Reproduce Steps to reproduce the behavior:

  1. Run the executor with multiple destinations

Additional Information

  • Dockerfile It does not matter which Dockerfile every docker file fails
  • Build Context
/kaniko/executor --cache --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/testing.Dockerfile" --destination "${IMAGE_TESTING}:${CI_COMMIT_SHORT_SHA}" --destination "${IMAGE_TESTING}:latest"

or

/kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/testing.Dockerfile" -d "${IMAGE_TESTING}:${CI_COMMIT_SHORT_SHA}" -d "${IMAGE_TESTING}:latest"

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [x]
Please check if this error is seen when you use --cache flag
  • - [x]
Please check if your dockerfile is a multistage dockerfile
  • - [x]

brammittendorff avatar Aug 03 '23 12:08 brammittendorff

We've successfully implemented the solution. Here's the code for future reference:

  script:
    # Build testing image
    - >-
      /kaniko/executor
      --build-arg PROJECT_TOKEN_NAME=${ACCESS_TOKEN_NAME}
      --build-arg PROJECT_TOKEN_PASSWORD=${ACCESS_TOKEN}
      --build-arg PACKAGE_NAME="${PACKAGE_NAME}"
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/testing.Dockerfile"
      --destination "${IMAGE_TESTING_HASH}"
      --destination "${IMAGE_TESTING_LATEST}"

Apologies for any inconvenience caused. Please feel free to close this ticket.

pescheck-bram avatar Aug 30 '23 12:08 pescheck-bram

This solution also work for me.

sam-ritter avatar Feb 04 '25 21:02 sam-ritter