Skip to content

The Kaniko commands

Hi Developers,

In the section "Telling GitLab to Build It for You" here The following line doesn't work for me:

- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json

But changing it to this(With protection against corruption) does:

- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d   '\n')\"}}}" > /kaniko/.docker/config.json

It also appears that neither ${CI_COMMIT_REF_NAME} and ${CI_COMMIT_SHORT_SHA} are not defined for me, the ci/cd breaks every time. However ${CI_COMMIT_TAG} is.

The git version I am using is git version 2.34.1.

Yvonne

Edited by Matthew Feickert