Fails on / in branch names
stefandoorn opened this issue · 2 comments
stefandoorn commented
$ docker build --cache-from $CI_DEV_IMAGE_WITH_TAG --tag $CI_DEV_IMAGE_WITH_TAG --target dev .
invalid argument "registry.gitlab.com/project/repo/dev:ci/behat" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
ERROR: Job failed: exit code 125
I think $CI_COMMIT_REF_SLUG should be used instead of $CI_COMMIT_REF_NAME: https://docs.gitlab.com/ee/ci/variables/#predefined-variables-environment-variables. The SLUG is stripped from anything that is potentially incompatible I think.
covex-nn commented
@stefandoorn you are right! I always used "valid" branches like feature-qwerty; and $CI_DEV_IMAGE_WITH_TAG was always valid too (and there were no errors like you mentioned).
Feel free to create a PR to fix this.