Hi,
I’m current trying to automate the building of my docker image, targeting the RaspberryPi CM4.
When I inspect a docker image I built locally on the CM4 and works on the CM4, I can see that the architecture, varient and os are set as follows:
"Architecture": "arm64",
"Variant": "v8",
"Os": "linux",
I’ve tried with both automated build in dockerhub and as a github workflow and both don’t build the image with the variant, which is stopping the image being used on the CM4. Here’s my current github workflow:
name: cli
on:
push:
branches: 265-make-a-docker-image-that-is-all-self-contained-for-the-mk4_ws
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64/v8, linux/amd64
file: ./Dockerfile
push: true
tags: rossrobotics/mk4_test:github
And my Dockerfile:
ARG ros_distro=humble
FROM --platform=$BUILDPLATFORM ros:${ros_distro}
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV ROS_DOMAIN_ID=200
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
WORKDIR /home/$USER/mk4_ws/src
COPY . .
WORKDIR /home/$USER/mk4_ws
The github workflow completes successfully as seen below
I can run the image successfully on my PC with docker run -it rossrobotics/mk4_test:github
But when i pull the image to the CM4 and inspect the image it doesn’t have the variant which prevents it from being run
"Architecture": "arm64",
"Os": "linux",
Any clues as to why its not getting built with the variant? Or how i can get it to build with the variant so the image will work on the CM4
Thanks in advance