Allow platform to be selected in image name
This commit is contained in:
parent
6cb8b5de22
commit
48ef238ceb
1 changed files with 3 additions and 2 deletions
|
@ -25,9 +25,10 @@ services:
|
|||
- docker buildx create --name cibuilder --driver docker-container --use
|
||||
- docker buildx inspect --bootstrap
|
||||
- docker login -u gitlab-ci-token -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
|
||||
- export platform_sanatized=$(echo ${PLATFORM:6} | sed 's#/#-#g')
|
||||
script:
|
||||
- docker buildx build --platform "${PLATFORM}" -f "${DOCKERFILE}" -t "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_SHA:0:8}" -t "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG}" --push .
|
||||
- if [[ "${CI_COMMIT_REF_SLUG}" == "main" ]]; then docker buildx build --platform "${PLATFORM}" -f "${DOCKERFILE}" -t "${CI_REGISTRY_IMAGE}/${NAME}:latest" --push . ; fi
|
||||
- docker buildx build --platform "${PLATFORM}" -f "${DOCKERFILE}" -t "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_SHA:0:8}" -t "${CI_REGISTRY_IMAGE}/${NAME}-${platform-sanatized}:${CI_COMMIT_SHA:0:8}" -t "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG}" -t "${CI_REGISTRY_IMAGE}/${NAME}-${platform-sanatized}:${CI_COMMIT_REF_SLUG}" --push .
|
||||
- if [[ "${CI_COMMIT_REF_SLUG}" == "main" ]]; then docker buildx build --platform "${PLATFORM}" -f "${DOCKERFILE}" -t "${CI_REGISTRY_IMAGE}/${NAME}:latest" -t "${CI_REGISTRY_IMAGE}/${NAME}-${platform-sanatized}:latest" --push . ; fi
|
||||
parallel:
|
||||
matrix:
|
||||
- PLATFORM:
|
||||
|
|
Loading…
Reference in a new issue