docs: fixed building page formatting and added base image info (#2210)

This commit is contained in:
Geoff Bourne 2023-06-13 07:59:03 -05:00 committed by GitHub
parent 61bc034589
commit 24f40c84ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,28 @@
Ensure buildx/BuildKit support is enabled and run:
```shell script
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push .
## Building image locally with alternate Java base
The following shows how to change the base Java image used by the build:
```shell
docker build --build-arg BASE_IMG=ghcr.io/graalvm/graalvm-ce:ol8-java11 -t IMG_PREFIX/minecraft-server:java11-graalvm .
```
To build for local testing, use:
## Building a multi-architecture image
```shell script
docker buildx build --platform=linux/amd64 --tag mc-multiarch --load .
Ensure buildx/BuildKit support is enabled and run the following to build multi-architecture and push to the repository as named by the image:
```shell
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag IMG_PREFIX/minecraft-server --push .
```
To build for local images, multi-architecture is not supported, use the following with buildx to load the image into the local daemon:
```shell
docker buildx build --tag IMG_PREFIX/minecraft-server --load .
```
or just a plain build
```shell
docker build -t IMG_PREFIX/minecraft-server .
```