Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
04e5001f
Commit
04e5001f
authored
Nov 30, 2021
by
Achref BEN SAAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable kaniko custom build context Changelog
parent
dfddb423
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lib/gitlab/ci/templates/Kaniko.gitlab-ci.yml
lib/gitlab/ci/templates/Kaniko.gitlab-ci.yml
+7
-1
No files found.
lib/gitlab/ci/templates/Kaniko.gitlab-ci.yml
View file @
04e5001f
...
@@ -11,6 +11,7 @@ kaniko-build:
...
@@ -11,6 +11,7 @@ kaniko-build:
# Additional options for Kaniko executor.
# Additional options for Kaniko executor.
# For more details see https://github.com/GoogleContainerTools/kaniko/blob/master/README.md#additional-flags
# For more details see https://github.com/GoogleContainerTools/kaniko/blob/master/README.md#additional-flags
KANIKO_ARGS
:
"
"
KANIKO_ARGS
:
"
"
KANIKO_BUILD_CONTEXT
:
$CI_PROJECT_DIR
stage
:
build
stage
:
build
image
:
image
:
# For latest releases see https://github.com/GoogleContainerTools/kaniko/releases
# For latest releases see https://github.com/GoogleContainerTools/kaniko/releases
...
@@ -40,8 +41,13 @@ kaniko-build:
...
@@ -40,8 +41,13 @@ kaniko-build:
# Write credentials to access Gitlab Container Registry within the runner/ci
# Write credentials to access Gitlab Container Registry within the runner/ci
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
# Build and push the container. To disable push add --no-push
# Build and push the container. To disable push add --no-push
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$VERSION $KANIKO_ARGS
-
DOCKERFILE_PATH=${DOCKERFILE_PATH:-"$KANIKO_BUILD_CONTEXT/Dockerfile"}
-
/kaniko/executor --context $KANIKO_BUILD_CONTEXT --dockerfile $DOCKERFILE_PATH --destination $CI_REGISTRY_IMAGE:$VERSION $KANIKO_ARGS
# Run this job in a branch/tag where a Dockerfile exists
# Run this job in a branch/tag where a Dockerfile exists
rules
:
rules
:
-
exists
:
-
exists
:
-
Dockerfile
-
Dockerfile
# custom Dockerfile path
-
if
:
$DOCKERFILE_PATH
# custom build context without an explicit Dockerfile path
-
if
:
$KANIKO_BUILD_CONTEXT != $CI_PROJECT_DIR
Write
Preview
Markdown
is supported
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