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
aa285a9d
Commit
aa285a9d
authored
Oct 21, 2021
by
Alex Eimer
Committed by
Marcel Amirault
Oct 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation: Fix/Prettify kankiko example
parent
a0ded336
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
doc/ci/docker/using_kaniko.md
doc/ci/docker/using_kaniko.md
+14
-5
No files found.
doc/ci/docker/using_kaniko.md
View file @
aa285a9d
...
@@ -64,8 +64,12 @@ build:
...
@@ -64,8 +64,12 @@ build:
entrypoint
:
[
"
"
]
entrypoint
:
[
"
"
]
script
:
script
:
-
mkdir -p /kaniko/.docker
-
mkdir -p /kaniko/.docker
-
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\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
-
>-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
rules
:
rules
:
-
if
:
$CI_COMMIT_TAG
-
if
:
$CI_COMMIT_TAG
```
```
...
@@ -91,14 +95,19 @@ build:
...
@@ -91,14 +95,19 @@ build:
-
mkdir -p /kaniko/.docker
-
mkdir -p /kaniko/.docker
-
|-
-
|-
KANIKOPROXYBUILDARGS=""
KANIKOPROXYBUILDARGS=""
KANIKOCFG="{\"auths\":{\"$
CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD}
| base64 | tr -d '\n')\"}}}"
KANIKOCFG="{\"auths\":{\"$
{CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}"
| base64 | tr -d '\n')\"}}}"
if [ "x${http_proxy}" != "x" -o "x${https_proxy}" != "x" ]; then
if [ "x${http_proxy}" != "x" -o "x${https_proxy}" != "x" ]; then
KANIKOCFG="${KANIKOCFG}, \"proxies\": { \"default\": { \"httpProxy\": \"${http_proxy}\", \"httpsProxy\": \"${https_proxy}\", \"noProxy\": \"${no_proxy}\"}}"
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}"
KANIKOPROXYBUILDARGS="--build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg no_proxy=${no_proxy}"
fi
fi
KANIKOCFG="${KANIKOCFG} }"
KANIKOCFG="${KANIKOCFG} }"
echo "${KANIKOCFG}" > /kaniko/.docker/config.json
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
-
>-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
"${KANIKOPROXYBUILDARGS}"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
rules
:
rules
:
-
if
:
$CI_COMMIT_TAG
-
if
:
$CI_COMMIT_TAG
```
```
...
@@ -120,7 +129,7 @@ store:
...
@@ -120,7 +129,7 @@ store:
```
yaml
```
yaml
before_script
:
before_script
:
-
mkdir -p /kaniko/.docker
-
mkdir -p /kaniko/.docker
-
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\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}"
| base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
-
|
-
|
echo "-----BEGIN CERTIFICATE-----
echo "-----BEGIN CERTIFICATE-----
...
...
...
...
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