GitLab system status is available
here
and
here
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kabir Kwatra
DotFiles
Commits
ef3334d8
Commit
ef3334d8
authored
Oct 18, 2020
by
Kabir Kwatra
☄
Browse files
fix(ci): Changed GitLab CI Build Tool to Kaniko for Rootless Runners
parent
305e0b6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
.github/gitlab/ci.yaml
View file @
ef3334d8
# Author: Kabir Kwatra <kabir@kwatra.me>
image
:
docker:19
services
:
[
"
docker:19-dind"
]
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
stages
:
[
build
]
before_script
:
-
docker info
-
echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
build
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
-
docker pull $CI_REGISTRY_IMAGE:latest ||
true
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
-
>
for containerfile_path in $(ls .github/containerfiles/*.Containerfile); do
containerfile_name=${containerfile_path##*/}
container_tag=${containerfile_name%%.*}
container_fulltag="$CI_REGISTRY_IMAGE:$container_tag"
echo "Building $containerfile_name with tag $container_fulltag"
docker build \
/kaniko/executor \
--context $CI_PROJECT_DIR \
--dockerfile $containerfile_path \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg OCI_SRC_URL=$CI_PROJECT_URL \
--cache-from $container_fulltag \
-f $containerfile_path \
-t $container_fulltag \
.
docker push $container_fulltag
--destination $container_fulltag
done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment