Skip to content

Commit a8ef9de

Browse files
Merge pull request #6 from rshu-bd/rshu/dockerfile_arm64
Dockerfile to build ARM64 Binary
2 parents 68ccf12 + 1e1a07b commit a8ef9de

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

README.md

+33-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
These messages were generated from [spot-sdk 3.2.0](https://github.com/boston-dynamics/spot-sdk/releases/tag/v3.2.0)
44

5-
65
## How to build `.deb`
76

87
(Largely borrowed from [here](https://gist.github.com/awesomebytes/196eab972a94dd8fcdd69adfe3bd1152))
98

109
### Get dependencies
10+
1111
You may need the latest pip, follow the [official instructions](https://pip.pypa.io/en/stable/installing/).
1212

1313
Install [bloom](http://ros-infrastructure.github.io/bloom/):
@@ -40,6 +40,7 @@ bloom-generate rosdebian --os-name ubuntu --os-version jammy --ros-distro humble
4040
```
4141

4242
You can also let the tool guess some stuff:
43+
4344
```bash
4445
bloom-generate rosdebian --ros-distro humble
4546
```
@@ -91,10 +92,13 @@ fakeroot debian/rules binary
9192
```
9293
9394
If you get the error:
95+
9496
```bash
9597
dh: Command not found
9698
```
99+
97100
You need to install:
101+
98102
```bash
99103
sudo apt-get install dpkg-dev debhelper
100104
```
@@ -107,4 +111,31 @@ dpkg-deb: building package 'ros-humble-bosdyn-msgs' in '../ros-humble-bosdyn-msg
107111
108112
### Upload debian to GitHub
109113
110-
You should now have a `.deb` file containing the `bosdyn_msgs` package. You need to upload that as a release to GitHub [here](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository). Please increment the version of the release. At some point we may consider automating this process but we don't have a formalized way of doing these precompilations yet.
114+
You should now have a `.deb` file containing the `bosdyn_msgs` package. You need to upload that as a release to GitHub [here](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository). Please increment the version of the release. At some point we may consider automating this process but we don't have a formalized way of doing these precompilations yet.
115+
116+
## Build package for ARM64
117+
118+
If you want to build the package for ARM64 architecture in non ARM64 host system you can do so through a docker container.
119+
120+
1. To create docker images on the development environment for a different architecture, first run the following commands:
121+
122+
```
123+
sudo apt-get install qemu binfmt-support qemu-user-static
124+
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
125+
```
126+
127+
2. Build the docker image with ARM64 target running Ubuntu 22.04 and ROS Humble.
128+
129+
```
130+
docker build -t bosdyn_msgs/arm64 --platform linux/arm64/v8 -f docker/arm64/Dockerfile .
131+
```
132+
133+
3. Run the docker image
134+
135+
```
136+
docker run -it bosdyn_msgs/arm64 /bin/bash
137+
```
138+
139+
4. Inside the container follow the steps in the **Create debian structure** section.
140+
141+
5. Copy the generated `.deb` file from the container to the host machine

docker/arm64/Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use a base image by OSRF that already contains ROS 2 Humble
2+
FROM arm64v8/ros:humble-ros-base-jammy
3+
4+
# Install system utilities
5+
RUN apt-get update && apt-get install -y \
6+
python3-pip \
7+
wget \
8+
iputils-ping
9+
10+
RUN pip install -U bloom
11+
12+
RUN apt-get update && apt-get install -y \
13+
fakeroot \
14+
dpkg-dev \
15+
debhelper
16+
17+
RUN git clone https://github.com/bdaiinstitute/bosdyn_msgs.git
18+
19+
CMD ["bash"]
20+

0 commit comments

Comments
 (0)