Skip to content

Commit

Permalink
Merge pull request #171 from pact-foundation/feat/release_multi_arch_…
Browse files Browse the repository at this point in the history
…without_multi_suffix

feat: release multi-arch images under main tags
  • Loading branch information
YOU54F authored Feb 26, 2024
2 parents 992aa59 + eb23705 commit d601374
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,14 @@ If you want to run the container as a standalone instance, then the `dius/pact-b

## Platforms

### Single platform images

By default, vanilla tags, are built only for `amd64`

- `--platform=linux/amd64`

```sh
docker run --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest -c 'uname -sm'
```

### Multi-manifest image

Multi-platform images are available, by appending `-multi` to any release tag
Multi-platform images are available

- `--platform=linux/amd64`
- `--platform=linux/arm/v7`
- `--platform=linux/arm64`

```sh
docker run --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest-multi -c 'uname -sm'
docker run --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest -c 'uname -sm'
```

## Prerequisites
Expand Down
14 changes: 3 additions & 11 deletions script/release-workflow/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@

set -euo >/dev/null

## Publish a multi arch build with -multi added to the tag
## ($TAG||$MAJOR_TAG||$LATEST)-multi
push_multi() {
## Publish a multi arch build
## ($TAG||$MAJOR_TAG||$LATEST)
push() {
## These will use cached builds, so wont build every time.
docker buildx build --platform=linux/amd64,linux/arm64,linux/arm \
--output=type=image,push=true \
-t ${DOCKER_IMAGE_ORG_AND_NAME}:$1-multi .
}
push() {
docker buildx build --platform=linux/amd64 \
--output=type=image,push=true \
-t ${DOCKER_IMAGE_ORG_AND_NAME}:$1 .
}

if [ -n "${MAJOR_TAG:-}" ]; then
push ${MAJOR_TAG}
push_multi ${MAJOR_TAG}
fi

push ${TAG}
push_multi ${TAG}

if [ "${PUSH_TO_LATEST}" != "false" ]; then
push latest
push_multi latest
fi

0 comments on commit d601374

Please sign in to comment.