quickfix to avoid kaniko stopping with

"kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue" error
applied as described here https://github.com/GoogleContainerTools/kaniko/issues/1542

its also done in veloren-docker-cli: c8aa8ac857

We didnt had that problem in veloren repo until now.
This commit is contained in:
Marcel Märtens 2021-07-19 13:33:19 +02:00
parent 9766b3e897
commit 9227390531

View File

@ -24,6 +24,9 @@ docker:
before_script: before_script:
- ls "$CI_PROJECT_DIR/server-cli/" - ls "$CI_PROJECT_DIR/server-cli/"
script: script:
# Help kaniko identify that it is running in a container.
# avoids this issue: https://github.com/GoogleContainerTools/kaniko/issues/1542
- export container=docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - 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/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:${CI_COMMIT_REF_NAME}" - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:${CI_COMMIT_REF_NAME}"
@ -37,6 +40,9 @@ docker-nightly:
before_script: before_script:
- ls "$CI_PROJECT_DIR/server-cli/" - ls "$CI_PROJECT_DIR/server-cli/"
script: script:
# Help kaniko identify that it is running in a container.
# avoids this issue: https://github.com/GoogleContainerTools/kaniko/issues/1542
- export container=docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - 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/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:nightly" - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:nightly"