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
75dfe11b
Commit
75dfe11b
authored
Jan 08, 2021
by
Sergio Oller
Committed by
Suzanne Selhorn
Jan 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: Add instructions to build a docker image with kaniko on a runner behind an http(s) proxy.
parent
2fb396e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
doc/ci/docker/using_kaniko.md
doc/ci/docker/using_kaniko.md
+33
-0
No files found.
doc/ci/docker/using_kaniko.md
View file @
75dfe11b
...
@@ -70,6 +70,39 @@ build:
...
@@ -70,6 +70,39 @@ build:
-
tags
-
tags
```
```
### Building an image with kaniko behind a proxy
If you use a custom GitLab Runner behind an http(s) proxy, kaniko needs to be set
up accordingly. This means:
-
Adding the proxy to
`/kaniko/.docker/config.json`
-
Passing the
`http_proxy`
environment variables as build args so the Dockerfile
instructions can use the proxy when building the image.
The previous example can be extended as follows:
```
yaml
build
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
-
mkdir -p /kaniko/.docker
-
|-
KANIKOPROXYBUILDARGS=""
KANIKOCFG="{ \"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}"
if [ "x${http_proxy}" != "x" -o "x${https_proxy}" != "x" ]; then
KANIKOCFG="${KANIKOCFG}, \"proxies\": { \"default\": { \"httpProxy\": \"${http_proxy}\", \"httpsProxy\": \"${https_proxy}\", \"noProxy\": \"${no_proxy}\"}}"
KANIKOPROXYBUILDARGS="--build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg no_proxy=${no_proxy}"
fi
KANIKOCFG="${KANIKOCFG} }"
echo "${KANIKOCFG}" > /kaniko/.docker/config.json
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile $KANIKOPROXYBUILDARGS --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only
:
-
tags
```
## Using a registry with a custom certificate
## Using a registry with a custom certificate
When trying to push to a Docker registry that uses a certificate that is signed
When trying to push to a Docker registry that uses a certificate that is signed
...
...
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