You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First I installed Docker Engine according to the installation instructions.
Find my Dockerfile below:
Expand to read Dockerfile
# Use an official ROS 2 base image (e.g., Humble Hawksbill on Ubuntu 22.04)# We use FROM ros:humble-ros-base
# Set environment variablesENV ROS_DISTRO=humble
# Update and install dependenciesRUN apt-get update && apt-get install -y \
build-essential \
python3-colcon-common-extensions \
python3-argcomplete \
bash-completion \
ros-humble-ament-cmake-clang-format \
git \
nano \
terminator \
python3-pip \
python3-rosdep \
python3-genmsg \
&& rm -rf /var/lib/apt/lists/*
# Configure userARG USERNAME=ats-devcontainer
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Create the userRUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& mkdir /home/$USERNAME/ros2_ws \
&& chown $USER_UID:$USER_GID /home/$USERNAME/ros2_ws
# Switch user from root to $USERNAMEUSER $USERNAME
# Change working directory to /ros2_wsWORKDIR /ros2_ws
# Add src folder to /ros2_wsRUN mkdir src
# Get the repositoryARG REPO_URL=https://github.com/PX4/px4_msgs.git
RUN git clone --depth 1 --recursive $REPO_URL /ros2_ws/src
# Install any ROS 2 package dependenciesRUN rosdep update \
&& rosdep install --from-paths src --ignore-src -r -y
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && colcon build"
Then, enable QEMU for emulation during cross-compiling
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
And Docker build for arm64
docker buildx build --platform=linux/arm64 .# Build for ARM, throws error
docker buildx build --platform=linux/amd64 .# Build for x86, works
The final project folder structure is standard:
workspace
├── Dockerfile
├── src
│ └── px4_msgs
What I tried
At first I thought it might be an issue with building messages in a Docker image, but I successfully built the ROS2 msg srv tutorial, proving that custom messages can be built. To do this I recreated the src of this package and copied it into the container using COPY. I attempted this with the px4_msgs package as well but got the same error, leading me to believe this is not the issue. This is also the reason I'm posting here and not in Docker or ROS2 forums.
I also attempted to allocate more memory (up to 12GB and 16GB swap, which I believe should be enough)
The issue
I'm encountering an issue when I try to build my ROS2 Docker image including the px4_msgs repository. My host machine is x86 and runs Ubuntu 22.04.
Command line output
How to reproduce
First I installed Docker Engine according to the installation instructions.
Find my Dockerfile below:
Expand to read Dockerfile
Then, enable QEMU for emulation during cross-compiling
And Docker build for arm64
The final project folder structure is standard:
workspace
├── Dockerfile
├── src
│ └── px4_msgs
What I tried
At first I thought it might be an issue with building messages in a Docker image, but I successfully built the ROS2 msg srv tutorial, proving that custom messages can be built. To do this I recreated the src of this package and copied it into the container using COPY. I attempted this with the px4_msgs package as well but got the same error, leading me to believe this is not the issue. This is also the reason I'm posting here and not in Docker or ROS2 forums.
I also attempted to allocate more memory (up to 12GB and 16GB swap, which I believe should be enough)
Expected result
The image compiles with no errors so I can deploy on an ARM-based single board computer.
This is the first time I'm submitting an issue to a public project so if there is any feedback on my formulation I'm open to learn.
Thanks
The text was updated successfully, but these errors were encountered: