Skip to content

Commit 83a5e06

Browse files
committedFeb 9, 2024
Docker: Add readme and add user docker files
Signed-off-by: rbudai <[email protected]>
1 parent a764379 commit 83a5e06

File tree

10 files changed

+281
-25
lines changed

10 files changed

+281
-25
lines changed
 

‎dockers/README.md

Whitespace-only changes.

‎dockers/lib_gen/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Using [DPKG packages](https://github.com/analogdevicesinc/tof-ros2?tab=readme-ov-file#download-debian-package)
2+
3+
These dockers are intended to prepare the tof dpkg packages for easy library setup for users.
4+
The generation can be done using the ```docker_build.sh```, by running:
5+
```console
6+
bash docker_build.sh
7+
```
8+
After the build is completed you can find the ```.dpkg``` tof dependency library files for tof-ros2
9+
10+
Installing the libraries:
11+
```console
12+
sudo dpkg -i tof_lib.deb

‎dockers/docker_build.sh ‎dockers/lib_gen/docker_build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo "Building dockers"
44
#Ubuntu 20
55
sudo docker build --tag ubuntu20.04/ros2_foxy ./ubuntu_20_04_foxy/
66
sudo docker build --tag ubuntu20.04/ros2_galactic ./ubuntu_20_04_galactic/
7-
# sudo docker build --tag ubuntu20.04/ros2_humble ./ubuntu_20_04_humble/
7+
sudo docker build --tag ubuntu20.04/ros2_humble ./ubuntu_20_04_humble/
88

99
#Ubuntu 22
1010
sudo docker build --tag ubuntu22.04/ros2_humble ./ubuntu_22_04_humble/

‎dockers/ubuntu_20_04_foxy/Dockerfile ‎dockers/lib_gen/ubuntu_20_04_foxy/Dockerfile

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM ubuntu:20.04
2-
32
LABEL maintainer="Robert Budai, <robert.budai@analog.com>"
43
ARG DEBIAN_FRONTEND=noninteractive
54

@@ -35,13 +34,13 @@ RUN \
3534
&& cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake \
3635
&& cmake --build . --target install
3736

38-
# #Install ToF SDK
39-
# RUN \
40-
# git clone https://github.com/analogdevicesinc/ToF \
41-
# && cd ToF \
42-
# && mkdir build && cd build \
43-
# && cmake -DUSE_DEPTH_COMPUTE_OPENSOURCE=1 -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
44-
# && cmake --build . --target install
37+
#Install ToF SDK
38+
RUN \
39+
git clone https://github.com/analogdevicesinc/ToF \
40+
&& cd ToF \
41+
&& mkdir build && cd build \
42+
&& cmake -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
43+
&& cmake --build . --target install
4544

4645
#Install ROS2
4746
RUN \

‎dockers/ubuntu_20_04_galactic/Dockerfile ‎dockers/lib_gen/ubuntu_20_04_galactic/Dockerfile

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM ubuntu:20.04
2-
32
LABEL maintainer="Robert Budai, <robert.budai@analog.com>"
43
ARG DEBIAN_FRONTEND=noninteractive
54

@@ -35,13 +34,13 @@ RUN \
3534
&& cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake \
3635
&& cmake --build . --target install
3736

38-
# #Install ToF SDK
39-
# RUN \
40-
# git clone https://github.com/analogdevicesinc/ToF \
41-
# && cd ToF \
42-
# && mkdir build && cd build \
43-
# && cmake -DUSE_DEPTH_COMPUTE_OPENSOURCE=1 -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
44-
# && cmake --build . --target install
37+
#Install ToF SDK
38+
RUN \
39+
git clone https://github.com/analogdevicesinc/ToF \
40+
&& cd ToF \
41+
&& mkdir build && cd build \
42+
&& cmake -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
43+
&& cmake --build . --target install
4544

4645
#Install ROS2
4746
RUN \

‎dockers/ubuntu_22_04_humble/Dockerfile ‎dockers/lib_gen/ubuntu_22_04_humble/Dockerfile

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM ubuntu:22.04
2-
32
LABEL maintainer="Robert Budai, <robert.budai@analog.com>"
43
ARG DEBIAN_FRONTEND=noninteractive
54

@@ -35,13 +34,13 @@ RUN \
3534
&& cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake \
3635
&& cmake --build . --target install
3736

38-
# #Install ToF SDK
39-
# RUN \
40-
# git clone https://github.com/analogdevicesinc/ToF \
41-
# && cd ToF \
42-
# && mkdir build && cd build \
43-
# && cmake -DUSE_DEPTH_COMPUTE_OPENSOURCE=1 -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
44-
# && cmake --build . --target install
37+
#Install ToF SDK
38+
RUN \
39+
git clone https://github.com/analogdevicesinc/ToF \
40+
&& cd ToF \
41+
&& mkdir build && cd build \
42+
&& cmake -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
43+
&& cmake --build . --target install
4544

4645
#Install ROS2
4746
RUN \

‎dockers/users/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dockers for tof and tof-ros2
2+
3+
## Running Docker files:
4+
Choose the appropriate ubuntu docker from the available list:
5+
* Ubuntu 20.04 ROS2 Foxy
6+
* Ubuntu 20.04 ROS2 Galactic
7+
* Ubuntu 22.04 ROS2 Humble
8+
9+
### Step 1:
10+
Build the Docker file with:
11+
```console
12+
sudo docker build --tag <build_tag> .
13+
```
14+
Or build from skratch:
15+
```console
16+
sudo docker build --no-cache --tag <build_tag> .
17+
``
18+
### Step 2:
19+
Run Docker image in container interactively:
20+
```console
21+
sudo docker run -it <docker_image_name>
22+
```
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM ubuntu:20.04
2+
LABEL maintainer="Robert Budai, <robert.budai@analog.com>"
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# Install updates to base image
6+
RUN \
7+
apt-get update -y \
8+
&& apt-get install -y git \
9+
&& apt-get install -y cmake \
10+
&& apt-get install -y build-essential \
11+
&& apt-get install apt-utils
12+
13+
# Install Glog
14+
RUN \
15+
git clone -b v0.6.0 --depth 1 https://github.com/google/glog \
16+
&& cd glog \
17+
&& mkdir build_0_6_0 && cd build_0_6_0 \
18+
&& cmake -DWITH_GFLAGS=off -DCMAKE_INSTALL_PREFIX=/opt/glog .. \
19+
&& cmake --build . --target install
20+
21+
# Install Libwebsoocket
22+
RUN \
23+
git clone --branch v3.1-stable --depth 1 https://github.com/warmcat/libwebsockets \
24+
&& cd libwebsockets \
25+
&& mkdir build_3_1 && cd build_3_1 \
26+
&& cmake -DLWS_WITH_SSL=OFF -DLWS_STATIC_PIC=ON -DCMAKE_INSTALL_PREFIX=/opt/websockets .. \
27+
&& cmake --build . --target install
28+
29+
# Install Protobuf
30+
RUN \
31+
git clone --branch v3.9.0 --depth 1 https://github.com/protocolbuffers/protobuf \
32+
&& cd protobuf \
33+
&& mkdir build_3_9_0 && cd build_3_9_0 \
34+
&& cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake \
35+
&& cmake --build . --target install
36+
37+
# Install ToF SDK
38+
RUN \
39+
git clone https://github.com/analogdevicesinc/ToF \
40+
&& cd ToF \
41+
&& mkdir build && cd build \
42+
&& cmake -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
43+
&& cmake --build . --target install
44+
45+
# Install ROS2
46+
RUN \
47+
locale \
48+
&& apt-get update && apt-get install locales \
49+
&& locale-gen en_US en_US.UTF-8 \
50+
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
51+
&& export LANG=en_US.UTF-8
52+
RUN \
53+
apt-get install -y software-properties-common \
54+
&& add-apt-repository universe \
55+
&& apt-get update \
56+
&& apt-get install -y curl
57+
RUN \
58+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
59+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null \
60+
&& apt-get update \
61+
&& apt-get upgrade -y
62+
RUN \
63+
apt-get install -y ros-foxy-desktop python3-argcomplete \
64+
&& apt-get install -y python3-colcon-common-extensions
65+
66+
# Install Tof ROS2
67+
RUN \
68+
mkdir ros2_ws && cd ros2_ws && mkdir src \
69+
&& cd src \
70+
&& git clone https://github.com/analogdevicesinc/tof-ros2
71+
72+
RUN \
73+
cd ros2_ws \
74+
&& source /opt/ros/galactic/setup.bash \
75+
&& colcon build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM ubuntu:20.04
2+
LABEL maintainer="Robert Budai, <robert.budai@analog.com>"
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# Install updates to base image
6+
RUN \
7+
apt-get update -y \
8+
&& apt-get install -y git \
9+
&& apt-get install -y cmake \
10+
&& apt-get install -y build-essential \
11+
&& apt-get install apt-utils
12+
13+
# Install Glog
14+
RUN \
15+
git clone -b v0.6.0 --depth 1 https://github.com/google/glog \
16+
&& cd glog \
17+
&& mkdir build_0_6_0 && cd build_0_6_0 \
18+
&& cmake -DWITH_GFLAGS=off -DCMAKE_INSTALL_PREFIX=/opt/glog .. \
19+
&& cmake --build . --target install
20+
21+
# Install Libwebsoocket
22+
RUN \
23+
git clone --branch v3.1-stable --depth 1 https://github.com/warmcat/libwebsockets \
24+
&& cd libwebsockets \
25+
&& mkdir build_3_1 && cd build_3_1 \
26+
&& cmake -DLWS_WITH_SSL=OFF -DLWS_STATIC_PIC=ON -DCMAKE_INSTALL_PREFIX=/opt/websockets .. \
27+
&& cmake --build . --target install
28+
29+
# Install Protobuf
30+
RUN \
31+
git clone --branch v3.9.0 --depth 1 https://github.com/protocolbuffers/protobuf \
32+
&& cd protobuf \
33+
&& mkdir build_3_9_0 && cd build_3_9_0 \
34+
&& cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake \
35+
&& cmake --build . --target install
36+
37+
# Install ToF SDK
38+
RUN \
39+
git clone https://github.com/analogdevicesinc/ToF \
40+
&& cd ToF \
41+
&& mkdir build && cd build \
42+
&& cmake -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
43+
&& cmake --build . --target install
44+
45+
# Install ROS2
46+
RUN \
47+
locale \
48+
&& apt-get update && apt-get install locales \
49+
&& locale-gen en_US en_US.UTF-8 \
50+
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
51+
&& export LANG=en_US.UTF-8
52+
RUN \
53+
apt-get install -y software-properties-common \
54+
&& add-apt-repository universe \
55+
&& apt-get update \
56+
&& apt-get install -y curl
57+
RUN \
58+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
59+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null \
60+
&& apt-get update \
61+
&& apt-get upgrade -y
62+
RUN \
63+
apt-get install -y ros-galactic-desktop python3-argcomplete \
64+
&& apt-get install -y python3-colcon-common-extensions
65+
66+
# Install Tof ROS2
67+
RUN \
68+
mkdir ros2_ws && cd ros2_ws && mkdir src \
69+
&& cd src \
70+
&& git clone https://github.com/analogdevicesinc/tof-ros2
71+
72+
RUN \
73+
cd ros2_ws \
74+
&& source /opt/ros/galactic/setup.bash \
75+
&& colcon build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM ubuntu:22.04
2+
LABEL maintainer="Robert Budai, <robert.budai@analog.com>"
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# Install updates to base image
6+
RUN \
7+
apt-get update -y \
8+
&& apt-get install -y git \
9+
&& apt-get install -y cmake \
10+
&& apt-get install -y build-essential \
11+
&& apt-get install apt-utils
12+
13+
#Install Glog
14+
RUN \
15+
git clone -b v0.6.0 --depth 1 https://github.com/google/glog \
16+
&& cd glog \
17+
&& mkdir build_0_6_0 && cd build_0_6_0 \
18+
&& cmake -DWITH_GFLAGS=off -DCMAKE_INSTALL_PREFIX=/opt/glog .. \
19+
&& cmake --build . --target install
20+
21+
#Install Libwebsoocket
22+
RUN \
23+
git clone --branch v3.1-stable --depth 1 https://github.com/warmcat/libwebsockets \
24+
&& cd libwebsockets \
25+
&& mkdir build_3_1 && cd build_3_1 \
26+
&& cmake -DLWS_WITH_SSL=OFF -DLWS_STATIC_PIC=ON -DCMAKE_INSTALL_PREFIX=/opt/websockets .. \
27+
&& cmake --build . --target install
28+
29+
#Install Protobuf
30+
RUN \
31+
git clone --branch v3.9.0 --depth 1 https://github.com/protocolbuffers/protobuf \
32+
&& cd protobuf \
33+
&& mkdir build_3_9_0 && cd build_3_9_0 \
34+
&& cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake \
35+
&& cmake --build . --target install
36+
37+
#Install ToF SDK
38+
RUN \
39+
git clone https://github.com/analogdevicesinc/ToF \
40+
&& cd ToF \
41+
&& mkdir build && cd build \
42+
&& cmake -DWITH_NETWORK=1 -DWITH_EXAMPLES=off -DCMAKE_PREFIX_PATH="/opt/glog;/opt/protobuf;/opt/websockets" .. \
43+
&& cmake --build . --target install
44+
45+
#Install ROS2
46+
RUN \
47+
locale \
48+
&& apt-get update && apt-get install locales \
49+
&& locale-gen en_US en_US.UTF-8 \
50+
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
51+
&& export LANG=en_US.UTF-8
52+
RUN \
53+
apt-get install -y software-properties-common \
54+
&& add-apt-repository universe \
55+
&& apt-get update \
56+
&& apt-get install -y curl
57+
RUN \
58+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
59+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null \
60+
&& apt-get update \
61+
&& apt-get upgrade -y
62+
RUN \
63+
apt-get install -y ros-humble-desktop python3-argcomplete \
64+
&& apt-get install -y python3-colcon-common-extensions
65+
66+
# Install Tof ROS2
67+
RUN \
68+
mkdir ros2_ws && cd ros2_ws && mkdir src \
69+
&& cd src \
70+
&& git clone https://github.com/analogdevicesinc/tof-ros2
71+
72+
RUN \
73+
. /opt/ros/humble/setup.sh \
74+
&& cd ros2_ws \
75+
&& colcon build

0 commit comments

Comments
 (0)
Please sign in to comment.