I'm trying to switch from dind, and I can build images with kaniko successfully, but there doesn't seem to be a way to tag the image, so future docker tag/push commands fail.
image:
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CONTAINER_IMAGE:latest
This works...
INFO[0182] Pushed image to 1 destinations
Job succeeded
...but the image that Kaniko builds doesn't seem to actually get tagged.
The reason this is a problem is that in a later step, when I want to do this (publish to Google Container Registry in this case):
- docker tag $CONTAINER_IMAGE:latest $GCR_CONTAINER_IMAGE:$CI_COMMIT_TAG
- docker push $GCR_CONTAINER_IMAGE:$CI_COMMIT_TAG
...I get the error that the image doesn't exit...
Error response from daemon: No such image
ERROR: Job failed: exit code 1
...so, how do I actually tag my image with Kaniko so that I can access it in later steps through standard docker tag/push commands?