image: alpinelinux/docker-cli:latest stages: - build - upload - manifest .build: stage: build script: - docker build -t $CI_PROJECT_NAME:latest-$ARCH . .build_with_arch: stage: build script: - docker build --build-arg ARCH=$DOCKER_ARCH/ -t $CI_PROJECT_NAME:latest-$ARCH . build-s390x: extends: .build variables: ARCH: s390x tags: - docker-alpine - s390x build-x86_64: extends: .build variables: ARCH: x86_64 tags: - docker-alpine - x86_64 build-x86: extends: .build_with_arch image: name: alpinelinux/docker-cli:latest-x86 entrypoint: ["linux32", "sh", "-c"] variables: ARCH: x86 DOCKER_ARCH: i386 tags: - docker-alpine - x86 .upload: stage: upload only: - master - tags before_script: - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD script: - > docker-push-image $CI_PROJECT_NAME:latest-$ARCH $DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest-$ARCH - > if [ -n "$CI_COMMIT_TAG" ]; then docker-push-image $CI_PROJECT_NAME:latest-$ARCH $DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG-$ARCH; fi upload-s390x: extends: .upload variables: ARCH: s390x tags: - docker-alpine - s390x upload-x86_64: extends: .upload variables: ARCH: x86_64 tags: - docker-alpine - x86_64 upload-x86: extends: .build image: alpinelinux/docker-cli:latest-x86 extends: .upload variables: ARCH: x86 tags: - docker-alpine - x86 create-manifest: stage: manifest variables: DOCKER_CLI_EXPERIMENTAL: enabled only: - master - tags tags: - docker-alpine before_script: - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD script: - > docker-push-manifest $DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest $DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest- s390x x86_64 x86 - > if [ -n "$CI_COMMIT_TAG" ]; then docker-push-manifest $DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG $DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG- s390x x86_64 x86 ; fi