Add BUILDKIT_INLINE_CACHE build arg to docker builder step (#3245)

# What this PR does
`BUILDKIT_INLINE_CACHE` is required by `--cache-from`, otherwise it
won't work.
It will improve build speeds when running `tilt up`

## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Ildar Iskhakov 2023-11-02 11:48:00 +08:00 committed by GitHub
parent f905ac5246
commit e89018f6ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -107,6 +107,8 @@ steps:
target: prod
config:
from_secret: gcr_admin
build_args:
- BUILDKIT_INLINE_CACHE=1
depends_on:
- Lint Backend
- Unit Test Backend
@ -128,6 +130,8 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
build_args:
- BUILDKIT_INLINE_CACHE=1
depends_on:
- Lint Backend
- Unit Test Backend
@ -244,6 +248,11 @@ steps:
# Be aware that the this plugin requires privileged capabilities, otherwise the integrated
# Docker daemon is not able to start.
privileged: true
environment:
# force docker to use buildkit feature, this will skip build stages that aren't required in
# the final image (ie. dev & dev-enterprise)
# https://github.com/docker/cli/issues/1134#issuecomment-406449342
DOCKER_BUILDKIT: 1
settings:
repo: grafana/oncall
tags: latest,${DRONE_TAG}
@ -255,6 +264,8 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
build_args:
- BUILDKIT_INLINE_CACHE=1
depends_on:
- set engine version

View file

@ -31,13 +31,11 @@ def plugin_json():
allow_k8s_contexts(["kind-kind"])
local_resource("download-cache", cmd="docker pull grafana/oncall:latest; docker tag grafana/oncall localhost:63628/grafana/oncall:latest")
# Build the image including frontend folder for pytest
docker_build_sub(
"localhost:63628/oncall/engine:dev",
context="./engine",
cache_from="localhost:63628/grafana/oncall:latest",
cache_from="grafana/oncall:latest",
# only=["./engine", "./grafana-plugin"],
ignore=["./grafana-plugin/test-results/", "./grafana-plugin/dist/", "./grafana-plugin/e2e-tests/"],
child_context=".",