Skip to content

Commit

Permalink
Merge pull request #3438 from balena-os/alexgg/apiversion
Browse files Browse the repository at this point in the history
Update docker API version in recipes to match balena API version
  • Loading branch information
flowzone-app[bot] authored Jul 22, 2024
2 parents ba25d47 + b129f29 commit 4e30b67
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions meta-balena-common/classes/image_types_balena.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ do_rootfs[vardeps] += "BALENA_BOOT_PARTITION_FILES"

# XXX(petrosagg): This should be eventually implemented using a docker-native daemon
IMAGE_CMD:docker () {
DOCKER_IMAGE=$(${IMAGE_CMD_TAR} -cv -C ${IMAGE_ROOTFS} . | DOCKER_API_VERSION=1.22 docker import -)
DOCKER_API_VERSION=1.22 docker save ${DOCKER_IMAGE} > ${BALENA_DOCKER_IMG}
DOCKER_IMAGE=$(${IMAGE_CMD_TAR} -cv -C ${IMAGE_ROOTFS} . | DOCKER_API_VERSION=${BALENA_API_VERSION} docker import -)
DOCKER_API_VERSION=${BALENA_API_VERSION} docker save ${DOCKER_IMAGE} > ${BALENA_DOCKER_IMG}
}

IMAGE_TYPEDEP:hostapp-ext4 = "docker"
Expand Down
3 changes: 3 additions & 0 deletions meta-balena-common/conf/distro/include/balena-os.inc
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ BALENA_SIGN_LABEL ?= "${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'balena-ef
BALENA_NONENC_BOOT_LABEL ?= "${@oe.utils.conditional('SIGN_API','','${BALENA_BOOT_LABEL}','${BALENA_SIGN_LABEL}',d)}"
BALENA_NONENC_BOOT_MOUNT ?= "/mnt/${@'${BALENA_NONENC_BOOT_LABEL}'.replace('balena-','')}"

# This is the docker API version for v20.10
# balena version --format '{{.Server.APIVersion}}'
BALENA_API_VERSION ?= "1.41"
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ do_compile () {
done

IMAGETAG="${PN}:$(date +%s)"
DOCKER_API_VERSION=1.22 docker build --tag ${IMAGETAG} ${B}/work
DOCKER_API_VERSION=1.22 docker save "$IMAGETAG" > ${B}/work/mkfs-hostapp-image.tar
DOCKER_API_VERSION=1.22 docker rmi "$IMAGETAG"
DOCKER_API_VERSION=${BALENA_API_VERSION} docker build --tag ${IMAGETAG} ${B}/work
DOCKER_API_VERSION=${BALENA_API_VERSION} docker save "$IMAGETAG" > ${B}/work/mkfs-hostapp-image.tar
DOCKER_API_VERSION=${BALENA_API_VERSION} docker rmi "$IMAGETAG"

sed -i "s/@IMAGE@/${IMAGETAG}/" ${B}/work/mkfs.hostapp
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ do_compile() {
cp -r "${WORKDIR}"/example_module ${B}/work/

IMAGETAG="${PN}:$(date +%s)"
DOCKER_API_VERSION=1.22 docker build --tag ${IMAGETAG} --build-arg kernel_arch=${ARCH} --build-arg cross_compile_prefix=${DEBIAN_TUPLE} ${B}/work
DOCKER_API_VERSION=1.22 docker rmi "$IMAGETAG"
DOCKER_API_VERSION=${BALENA_API_VERSION} docker build --tag ${IMAGETAG} --build-arg kernel_arch=${ARCH} --build-arg cross_compile_prefix=${DEBIAN_TUPLE} ${B}/work
DOCKER_API_VERSION=${BALENA_API_VERSION} docker rmi "$IMAGETAG"
}

# Explicitly depend on the do_deploy step as we use the deployed artefacts. DEPENDS doesn't cover that
Expand Down

0 comments on commit 4e30b67

Please sign in to comment.