Loading .gitlab-ci.yml +7 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,13 @@ jobs:buildah: - local: tests/jobs/buildah.yml strategy: depend jobs:docker-arm64: stage: test trigger: include: - local: tests/jobs/docker-arm64.yml strategy: depend jobs:docs: stage: test trigger: Loading README.md +2 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,8 @@ variables: # Monorepo (multiple Dockerfiles) or polyrepo (one Dockerfile) We support both! Read [this](pipelines/container.md) for more information on how to configure pipelines for monorepos and polyrepos. We support both! Read [this](container/readme.md) for more information on how to configure pipelines for monorepos and polyrepos. ## Contributing Loading container/docker.yml 0 → 100644 +36 −0 Original line number Diff line number Diff line --- include: - local: container/image.yml variables: DOCKER_EXTRA_ARGS: "" .docker: stage: build extends: [".image:rules", ".image:name"] image: name: docker.io/docker:latest entrypoint: [""] variables: DOCKER_HOST: tcp://docker:2375/ services: - name: docker.io/docker:dind alias: docker script: - !reference [".image:name", script] - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} - docker buildx create --use - | if [ "${IMAGE_ARCHITECTURES}" != "" ]; then DOCKER_EXTRA_ARGS="${DOCKER_EXTRA_ARGS} --platform ${IMAGE_ARCHITECTURES}" fi - | if [ "${DOCKER_EXTRA_ARGS}" != "" ]; then echo "[*] Applying the extra arguments '${DOCKER_EXTRA_ARGS}'." fi - | docker buildx build --push \ --tag ${IMAGE_NAME}:${IMAGE_TAG} \ --tag ${IMAGE_NAME}:${IMAGE_DEV_TAG} \ -f ${IMAGE_CONTAINERFILE} ${DOCKER_EXTRA_ARGS} . container/readme.md +22 −0 Original line number Diff line number Diff line Loading @@ -119,3 +119,25 @@ grype:subdir_b: needs: - image:build:subdir_b # Optional, but may speed up your pipeline ``` ## Multiple architectures To build for multiple architectures, you need the Docker builder. The following example will show how to have a single Dockerfile built for both amd64 and arm64. ```yaml --- include: - project: just-ci/templates file: templates/container.yml ref: v6.11.0 .image:build: extends: .docker variables: IMAGE_ARCHITECTURES: linux/arm64,linux/amd64 # Comma separated list. For example: "linux/amd64,linux/ppc64le,linux/arm64,linux/s390x". ``` That's all! All platforms are pushed to the same tag. pipelines/container.yml +1 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ include: - local: project-automation/workflow.yml - local: container/kaniko.yml - local: container/buildah.yml - local: container/docker.yml - local: container/grype.yml # set the project container dev image to the image for all jobs without a job-level default image Loading Loading
.gitlab-ci.yml +7 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,13 @@ jobs:buildah: - local: tests/jobs/buildah.yml strategy: depend jobs:docker-arm64: stage: test trigger: include: - local: tests/jobs/docker-arm64.yml strategy: depend jobs:docs: stage: test trigger: Loading
README.md +2 −2 Original line number Diff line number Diff line Loading @@ -138,8 +138,8 @@ variables: # Monorepo (multiple Dockerfiles) or polyrepo (one Dockerfile) We support both! Read [this](pipelines/container.md) for more information on how to configure pipelines for monorepos and polyrepos. We support both! Read [this](container/readme.md) for more information on how to configure pipelines for monorepos and polyrepos. ## Contributing Loading
container/docker.yml 0 → 100644 +36 −0 Original line number Diff line number Diff line --- include: - local: container/image.yml variables: DOCKER_EXTRA_ARGS: "" .docker: stage: build extends: [".image:rules", ".image:name"] image: name: docker.io/docker:latest entrypoint: [""] variables: DOCKER_HOST: tcp://docker:2375/ services: - name: docker.io/docker:dind alias: docker script: - !reference [".image:name", script] - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} - docker buildx create --use - | if [ "${IMAGE_ARCHITECTURES}" != "" ]; then DOCKER_EXTRA_ARGS="${DOCKER_EXTRA_ARGS} --platform ${IMAGE_ARCHITECTURES}" fi - | if [ "${DOCKER_EXTRA_ARGS}" != "" ]; then echo "[*] Applying the extra arguments '${DOCKER_EXTRA_ARGS}'." fi - | docker buildx build --push \ --tag ${IMAGE_NAME}:${IMAGE_TAG} \ --tag ${IMAGE_NAME}:${IMAGE_DEV_TAG} \ -f ${IMAGE_CONTAINERFILE} ${DOCKER_EXTRA_ARGS} .
container/readme.md +22 −0 Original line number Diff line number Diff line Loading @@ -119,3 +119,25 @@ grype:subdir_b: needs: - image:build:subdir_b # Optional, but may speed up your pipeline ``` ## Multiple architectures To build for multiple architectures, you need the Docker builder. The following example will show how to have a single Dockerfile built for both amd64 and arm64. ```yaml --- include: - project: just-ci/templates file: templates/container.yml ref: v6.11.0 .image:build: extends: .docker variables: IMAGE_ARCHITECTURES: linux/arm64,linux/amd64 # Comma separated list. For example: "linux/amd64,linux/ppc64le,linux/arm64,linux/s390x". ``` That's all! All platforms are pushed to the same tag.
pipelines/container.yml +1 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ include: - local: project-automation/workflow.yml - local: container/kaniko.yml - local: container/buildah.yml - local: container/docker.yml - local: container/grype.yml # set the project container dev image to the image for all jobs without a job-level default image Loading