Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jitsi-cert-auth
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Hartig
jitsi-cert-auth
Commits
67a13b6f
Commit
67a13b6f
authored
2 years ago
by
Jan Hartig
Browse files
Options
Downloads
Plain Diff
Merge branch 'kaniko' into 'main'
Use Kaniko for image builds See merge request
!20
parents
928d22e5
1fc45369
Branches
Branches containing commit
Tags
1.3
Tags containing commit
1 merge request
!20
Use Kaniko for image builds
Pipeline
#22069
passed
1 year ago
Stage: build
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+14
-22
14 additions, 22 deletions
.gitlab-ci.yml
with
14 additions
and
22 deletions
.gitlab-ci.yml
+
14
−
22
View file @
67a13b6f
docker-build
:
image
:
docker:24-dind
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
"
"
services
:
-
name
:
docker:24-dind
alias
:
docker
command
:
[
"
--tls=false"
]
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
build
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint
:
[
"
"
]
script
:
-
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
tag="
latest
"
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag="
:
$CI_COMMIT_REF_NAME"
tag="$CI_COMMIT_REF_NAME"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
-
docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
-
docker push "$CI_REGISTRY_IMAGE${tag}"
# Run this job in a branch where a Dockerfile exists
-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--build-arg http_proxy=$http_proxy
--build-arg https_proxy=$https_proxy
--build-arg no_proxy=$no_proxy
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "$CI_REGISTRY_IMAGE:${tag}"
rules
:
-
if
:
$CI_COMMIT_BRANCH
exists
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment