Loading .gitlab-ci.yml +11 −24 Original line number Diff line number Diff line image: docker:stable variables: DOCKER_HOST: "tcp://docker:2375/" DOCKER_DRIVER: "overlay2" DOCKER_TLS_CERTDIR: "" DOCKER_BUILDKIT: "1" services: - docker:dind before_script: - docker info - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" .build: &build stage: build image: docker.kodo.org.uk/ci-images/buildkit/buildctl:latest tags: [buildkit] script: - TARGET=${CI_JOB_NAME##*:} - BUILD_TAG=${CI_REGISTRY_IMAGE}/${TARGET}/build:${CI_PIPELINE_ID} - docker build . --pull=true --tag=${BUILD_TAG} --target=${TARGET} ${NGINX_VERSION:+--build-arg=nginx_version=$NGINX_VERSION} ${PHP_VERSION:+--build-arg=php_version=$PHP_VERSION} ${WORDPRESS_VERSION:+--build-arg=wp_version=$WORDPRESS_VERSION} - docker push ${BUILD_TAG} - buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt target=${TARGET} ${NGINX_VERSION:+--opt build-arg:nginx_version=$NGINX_VERSION} ${PHP_VERSION:+--opt build-arg:php_version=$PHP_VERSION} ${WORDPRESS_VERSION:+--opt build-arg:wp_version=$WORDPRESS_VERSION} --output type=image,name=${BUILD_TAG},push=true .changes: &only-changes only: &change-files Loading Loading
.gitlab-ci.yml +11 −24 Original line number Diff line number Diff line image: docker:stable variables: DOCKER_HOST: "tcp://docker:2375/" DOCKER_DRIVER: "overlay2" DOCKER_TLS_CERTDIR: "" DOCKER_BUILDKIT: "1" services: - docker:dind before_script: - docker info - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" .build: &build stage: build image: docker.kodo.org.uk/ci-images/buildkit/buildctl:latest tags: [buildkit] script: - TARGET=${CI_JOB_NAME##*:} - BUILD_TAG=${CI_REGISTRY_IMAGE}/${TARGET}/build:${CI_PIPELINE_ID} - docker build . --pull=true --tag=${BUILD_TAG} --target=${TARGET} ${NGINX_VERSION:+--build-arg=nginx_version=$NGINX_VERSION} ${PHP_VERSION:+--build-arg=php_version=$PHP_VERSION} ${WORDPRESS_VERSION:+--build-arg=wp_version=$WORDPRESS_VERSION} - docker push ${BUILD_TAG} - buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt target=${TARGET} ${NGINX_VERSION:+--opt build-arg:nginx_version=$NGINX_VERSION} ${PHP_VERSION:+--opt build-arg:php_version=$PHP_VERSION} ${WORDPRESS_VERSION:+--opt build-arg:wp_version=$WORDPRESS_VERSION} --output type=image,name=${BUILD_TAG},push=true .changes: &only-changes only: &change-files Loading