From 3d402b4eeca08ac3825622f2bc7099549d26aba8 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Wed, 1 Nov 2023 09:34:39 +0100 Subject: [PATCH] Upgrade binfmt and update build instructions (#432) Signed-off-by: Wouter Born --- README.md | 15 ++++++--------- helper-functions | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4ab6f553..a4bd9d0c 100644 --- a/README.md +++ b/README.md @@ -515,26 +515,23 @@ For more information on this see the [Docker documentation](https://docs.docker. Checkout the GitHub repository, change to a directory containing a Dockerfile (e.g. `/debian`) and then run these commands to build and run a Docker image for your current platform: ```shell -$ docker build --build-arg JAVA_VERSION=11 --build-arg OPENHAB_VERSION=4.0.3 --tag openhab/openhab . +$ docker build --build-arg JAVA_VERSION=17 --build-arg OPENHAB_VERSION=4.0.3 --tag openhab/openhab . $ docker run openhab/openhab ``` -To be able to build the same image for other platforms (e.g. arm/v7, arm64 on amd64) Docker CE 19.03 with BuildKit support can be used. +To be able to build the same image for other platforms (e.g. arm/v7, arm64 on amd64) Docker CE with BuildKit support can be used. -First enable BuildKit support, configure QEMU binary formats and a builder using: +First configure QEMU binary formats and a builder using: ```shell -$ echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json -$ export DOCKER_CLI_EXPERIMENTAL=enabled -$ docker run --privileged --rm tonistiigi/binfmt:qemu-v6.1.0 --install all -$ sudo systemctl restart docker +$ docker run --privileged --rm tonistiigi/binfmt:qemu-v8.0.4 --install all $ docker buildx create --name builder --use ``` Change to a directory containing a Dockerfile (e.g. `/debian`) and then use the following command to build an ARMv7 image: -``` -$ docker buildx build --build-arg JAVA_VERSION=11 --build-arg OPENHAB_VERSION=4.0.3 --platform linux/arm/v7 --tag openhab/openhab --load . +```shell +$ docker buildx build --build-arg JAVA_VERSION=17 --build-arg OPENHAB_VERSION=4.0.3 --platform linux/arm/v7 --tag openhab/openhab --load . ``` The `build` script in the root of the repository helps to simplify building the openHAB images with BuildKit. diff --git a/helper-functions b/helper-functions index 995ca7fa..2d597f2e 100644 --- a/helper-functions +++ b/helper-functions @@ -203,7 +203,7 @@ update_dockerhub_readme() { prepare_builder() { if [ "$BUILDER" == "" ]; then - docker run --privileged --rm tonistiigi/binfmt:qemu-v7.0.0 --install all &> /dev/null + docker run --privileged --rm tonistiigi/binfmt:qemu-v8.0.4 --install all &> /dev/null (docker buildx inspect builder &> /dev/null && echo -e "\nReusing existing builder") || \ (docker buildx create --name builder --use &> /dev/null && echo -e "\nCreated builder") BUILDER="builder"