2021-05-20 02:54:57 +08:00
|
|
|
.container_job_template:
|
2022-05-27 23:36:01 +08:00
|
|
|
extends: .base_job_template
|
2023-05-31 22:06:54 +08:00
|
|
|
image: docker:latest
|
2021-05-20 02:54:57 +08:00
|
|
|
stage: containers
|
|
|
|
services:
|
2023-05-31 22:06:54 +08:00
|
|
|
- docker:dind
|
2021-05-20 02:54:57 +08:00
|
|
|
before_script:
|
2023-06-09 00:40:14 +08:00
|
|
|
- export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:$QEMU_CI_CONTAINER_TAG"
|
|
|
|
# Always ':latest' because we always use upstream as a common cache source
|
2023-03-01 03:06:44 +08:00
|
|
|
- export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
|
2021-05-20 02:54:57 +08:00
|
|
|
- docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
2023-05-23 01:41:52 +08:00
|
|
|
- until docker info; do sleep 1; done
|
2021-05-20 02:54:57 +08:00
|
|
|
script:
|
|
|
|
- echo "TAG:$TAG"
|
|
|
|
- echo "COMMON_TAG:$COMMON_TAG"
|
2023-03-01 03:06:44 +08:00
|
|
|
- docker build --tag "$TAG" --cache-from "$TAG" --cache-from "$COMMON_TAG"
|
|
|
|
--build-arg BUILDKIT_INLINE_CACHE=1
|
|
|
|
-f "tests/docker/dockerfiles/$NAME.docker" "."
|
2021-05-20 02:54:57 +08:00
|
|
|
- docker push "$TAG"
|
|
|
|
after_script:
|
|
|
|
- docker logout
|