1fb3c0334SPhilippe Mathieu-Daudé.container_job_template:
2e312d1fdSDaniel P. Berrangé  extends: .base_job_template
348727e57SRichard Henderson  image: docker:stable
4fb3c0334SPhilippe Mathieu-Daudé  stage: containers
5fb3c0334SPhilippe Mathieu-Daudé  services:
65f63a67aSCamilla Conte    - docker:stable-dind
7fb3c0334SPhilippe Mathieu-Daudé  before_script:
8fb3c0334SPhilippe Mathieu-Daudé    - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
994b8b146SFabiano Rosas    - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
10fb3c0334SPhilippe Mathieu-Daudé    - apk add python3
11fb3c0334SPhilippe Mathieu-Daudé    - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
12*b105ce60SCamilla Conte    - until docker info; do sleep 1; done
13fb3c0334SPhilippe Mathieu-Daudé  script:
14fb3c0334SPhilippe Mathieu-Daudé    - echo "TAG:$TAG"
15fb3c0334SPhilippe Mathieu-Daudé    - echo "COMMON_TAG:$COMMON_TAG"
1694b8b146SFabiano Rosas    - docker build --tag "$TAG" --cache-from "$TAG" --cache-from "$COMMON_TAG"
1794b8b146SFabiano Rosas      --build-arg BUILDKIT_INLINE_CACHE=1
1894b8b146SFabiano Rosas      -f "tests/docker/dockerfiles/$NAME.docker" "."
19fb3c0334SPhilippe Mathieu-Daudé    - docker push "$TAG"
20fb3c0334SPhilippe Mathieu-Daudé  after_script:
21fb3c0334SPhilippe Mathieu-Daudé    - docker logout
22