diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b3f09a90d0504b298ca113348d617cdcf6c3adc..52b670a39f24910a6e1cc289f420cdf02f75632a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,18 +1,16 @@
+include:
+  - local: "register-dockerfile/register-dockerfile.yml"
+
 .build-image:
-  tags:
-    - linux
-    - small
-  image: docker
+  extends: .register-dockerfile-prepare
+  stage: test
   rules:
     - changes:
-        - $image_template/*
-  script:
-    - docker build -t "$CI_REGISTRY_IMAGE/$image_name" "$image_template" --build-arg $build_arg
-    - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
-    - docker push "$CI_REGISTRY_IMAGE/$image_name"
+        - .gitlab-ci.yml
+        - $image_name/*
   variables:
-    image_template: $image_name
-    build_arg:
+    docker_build_root: $image_name
+    image_tag: "latest"
 
 python3-cloudstack:
   extends: .build-image
@@ -28,11 +26,13 @@ rust:
   extends: .build-image
   variables:
     image_name: rust
-    build_arg: tag=latest
+    docker_build_options: --build-arg tag=latest
 
 rust-1.72:
   extends: .build-image
   variables:
-    image_name: rust:1.72
-    image_template: rust
-    build_arg: tag=1.72
+    image_name: rust
+# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/22648
+# "variable definition must be either a string or a hash"
+    image_tag: "1.72"
+    docker_build_options: --build-arg tag=1.72
diff --git a/register-dockerfile/README.md b/register-dockerfile/README.md
index ed59a92e84dd0bda776ab815d30eb0b96f8e855c..51857ca2c3b92d6e84e97001335ac382cde78559 100644
--- a/register-dockerfile/README.md
+++ b/register-dockerfile/README.md
@@ -10,7 +10,8 @@ You may add the following lines to include this template in your
 pipeline specification.
 ```yaml
 include:
-  - "https://gitlab.inria.fr/inria-ci/docker/-/raw/main/register-dockerfile/register-dockerfile.yml"
+  - project: "inria-ci/docker"
+    file: "/register-dockerfile/register-dockerfile.yml"
 ```
 
 This template defines two