Skip to content

Commit

Permalink
✨ multi-arch builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanbekker authored Jul 12, 2024
1 parent 567209d commit 0ce46f9
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Index:
- [Template Variables](#template-variables)
- [Permissions](#permissions)
- [Update](#update)
- [Multi-Arch Builds](#multi-arch-builds)
- [docker-compose](#docker-compose)
- [build](#docker-compose-build)
- [healthchecks](#docker-compose-healthchecks)
Expand Down Expand Up @@ -236,6 +237,43 @@ Add a constraint to move to a worker node:
$ docker service update --constraint-add 'node.role==worker' my-service-name
```

### Multi-Arch Builds

Install Docker Buildx CLI Plugin:

```bash
docker run --privileged --rm tonistiigi/binfmt --install all
```

Create a new builder instance:

```bash
docker buildx create --name multi-arch-builder
docker buildx use multi-arch-builder
docker buildx inspect --bootstrap
```

Dockerfile example:

```Dockerfile
# syntax=docker/dockerfile:1
FROM alpine:latest
RUN apk add --no-cache curl
CMD ["curl", "--version"]
```

Build the docker image for multiple architectures:

```bash
docker buildx build --platform linux/amd64,linux/arm64 -t yourusername/yourimage:tag .
```

Or; Build and push to a registry:

```bash
docker buildx build --platform linux/amd64,linux/arm64 -t yourusername/yourimage:tag --push .
```

## Docker Compose

### Docker Compose Build
Expand Down

0 comments on commit 0ce46f9

Please sign in to comment.