Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command for multi-platform image build #64

Open
wants to merge 3 commits into
base: humble
Choose a base branch
from

Conversation

khssnv
Copy link

@khssnv khssnv commented Jan 17, 2024

If the user never made multi-platform docker image build, a step 2 of the readme fails at the first RUN directives of the dockerfile with a not obvious error shown under a toggle below. This patch adds multi-platform build support as recommended in docker/buildx#1986, https://docs.docker.com/build/building/multi-platform/#qemu.

Also minor typo fixes.

docker buildx build --platform arm64 --build-arg USE_RVIZ=0 --build-arg SIM=0 --build-arg ROS_DISTRO=humble --build-arg CORE_NUM=10 -f Dockerfile --squash -t khassanov/rae-ros-robot:humble --load .
docker buildx build --platform arm64 --build-arg USE_RVIZ=0 --build-arg SIM=0 --build-arg ROS_DISTRO=humble --build-arg CORE_NUM=10 -f Dockerfile --squash -t khassanov/rae-ros-robot:humble --load .
WARNING: experimental flag squash is removed with BuildKit. You should squash inside build using a multi-stage Dockerfile for efficiency.
[+] Building 2.3s (6/20)                                                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                           0.1s
 => => transferring dockerfile: 2.12kB                                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                                              0.1s
 => => transferring context: 66B                                                                                                                                                               0.0s
 => [internal] load metadata for ghcr.io/luxonis/rae-base:2023.12.19                                                                                                                           1.5s
 => CACHED [ 1/16] FROM ghcr.io/luxonis/rae-base:2023.12.19@sha256:df6ceda4432b3839da9d737178f0b34628f28012dfbb2d614640885888d8b243                                                            0.0s
 => [internal] load build context                                                                                                                                                              0.1s
 => => transferring context: 10.64kB                                                                                                                                                           0.0s
 => ERROR [ 2/16] RUN apt-get update && apt-get -y install --no-install-recommends     software-properties-common     libusb-1.0-0-dev     python3-colcon-common-extensions     python3-rosde  0.5s
------                                                                                                                                                                                              
 > [ 2/16] RUN apt-get update && apt-get -y install --no-install-recommends     software-properties-common     libusb-1.0-0-dev     python3-colcon-common-extensions     python3-rosdep     build-essential     gpiod     libasound2-dev     ros-humble-cv-bridge     ros-humble-image-transport     ros-humble-image-transport-plugins     ros-humble-rmw-cyclonedds-cpp     gstreamer1.0-plugins-bad     alsa-utils     mpg123     libmpg123-dev     ros-humble-rtabmap-slam     unzip     ffmpeg     ros-humble-image-proc     git     htop     libsndfile1-dev     libsndfile1:
0.395 exec /bin/sh: exec format error
------
Dockerfile:7
--------------------
   6 |     
   7 | >>> RUN apt-get update && apt-get -y install --no-install-recommends \
   8 | >>>     software-properties-common \
   9 | >>>     libusb-1.0-0-dev \
  10 | >>>     python3-colcon-common-extensions \
  11 | >>>     python3-rosdep \
  12 | >>>     build-essential \
  13 | >>>     gpiod \
  14 | >>>     libasound2-dev \
  15 | >>>     ros-humble-cv-bridge \ 
  16 | >>>     ros-humble-image-transport \
  17 | >>>     ros-humble-image-transport-plugins \
  18 | >>>     ros-humble-rmw-cyclonedds-cpp \
  19 | >>>     gstreamer1.0-plugins-bad \
  20 | >>>     alsa-utils \
  21 | >>>     mpg123 \
  22 | >>>     libmpg123-dev \
  23 | >>>     ros-humble-rtabmap-slam \ 
  24 | >>>     unzip \
  25 | >>>     ffmpeg \
  26 | >>>     ros-humble-image-proc \
  27 | >>>     git \
  28 | >>>     htop \
  29 | >>>     libsndfile1-dev \
  30 | >>>     libsndfile1
  31 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get -y install --no-install-recommends     software-properties-common     libusb-1.0-0-dev     python3-colcon-common-extensions     python3-rosdep     build-essential     gpiod     libasound2-dev     ros-humble-cv-bridge     ros-humble-image-transport     ros-humble-image-transport-plugins     ros-humble-rmw-cyclonedds-cpp     gstreamer1.0-plugins-bad     alsa-utils     mpg123     libmpg123-dev     ros-humble-rtabmap-slam     unzip     ffmpeg     ros-humble-image-proc     git     htop     libsndfile1-dev     libsndfile1" did not complete successfully: exit code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant