Commit 9df2160c authored by Thomas Boni's avatar Thomas Boni Committed by Protocole
Browse files

Resolve "[job][docker_build] Optimize job by using "--use-new-run" option"

parent 3980d332
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -61,5 +61,6 @@ The registry and tag of the resulting Docker image follow this behavior:
| `DOCKERFILE_PATH` | Path to Dockerfile from the repository root | `Dockerfile` |
| `DOCKER_USE_CACHE` | Cache Dockerfile layers. Cached layers are stored in the [container registry](https://docs.gitlab.com/ee/user/packages/container_registry/){:target="_blank"} in `/cache` repository | `false` |
| `DOCKER_CACHE_TTL` | Cached layers TTL | `336h` |
| `KANIKO_USE_NEWRUN` | Enable Kaniko option [`--use-new-run`](https://github.com/GoogleContainerTools/kaniko#--use-new-run) | `true` |
| `DOCKER_VERBOSITY` | Set the verbosity of the build in job's log (see [levels](https://github.com/GoogleContainerTools/kaniko#--verbosity){:target="_blank"})  |  `info` |
| `DOCKER_OPTIONS`   | If you want to use additional [options](https://github.com/GoogleContainerTools/kaniko#additional-flags){:target="_blank"} | ` ` |
+7 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ stages:
docker_build:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug-v0.20.0
    name: gcr.io/kaniko-project/executor:v1.5.1-debug
    entrypoint: [""]
  variables:
    CUSTOM_REGISTRY: ""
@@ -21,6 +21,8 @@ docker_build:
    DOCKER_USE_CACHE: "false"
    DOCKER_CACHE_TTL: "336h"

    KANIKO_USE_NEWRUN: "true"

    DOCKER_VERBOSITY: "info"
    DOCKER_OPTIONS: ""
  script:
@@ -49,6 +51,10 @@ docker_build:
    -   DOCKER_OPTIONS="--cache=true --cache-ttl=${DOCKER_CACHE_TTL} ${DOCKER_OPTIONS}"
    - fi

    - if [ "${KANIKO_USE_NEWRUN}" = "true" ]; then
    -   DOCKER_OPTIONS="--use-new-run ${DOCKER_OPTIONS}"
    - fi

    - DOCKER_OPTIONS="--verbosity=${DOCKER_VERBOSITY} ${DOCKER_OPTIONS}"

    - if [ ! -z ${CUSTOM_TAG} ]; then
+2 −0
Original line number Diff line number Diff line
* Add new option `--use-new-run` to kaniko executor (enabled by default)
* Update kaniko image to `v1.5.1`
+4 −4
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

This job allows you to run the unit tests of 🐘 Gradle project.

You can easily have a badge configure on your 🦊 Gitlab project with this regex `([0-9]{1,3}.[0-9]*).%.covered` configured in `settings/ci_cd` section. See galery for example.
You can easily have a badge configure on your 🦊 Gitlab project with this regex `([0-9]{1,3}.[0-9]*).%.covered` configured in `settings/ci_cd` section. See gallery for example.

## How to use it