Skip to content

Commit d635bef

Browse files
committed
fix ROS2 install on containers
1 parent f795c9c commit d635bef

10 files changed

+61
-86
lines changed

.github/workflows/docker_builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ jobs:
268268
- uses: actions/checkout@v1
269269
- uses: julianoes/Publish-Docker-Github-Action@master
270270
with:
271-
name: px4io/px4-dev-ros-melodic
271+
name: px4io/px4-dev-ros-noetic
272272
username: ${{ secrets.DOCKER_USERNAME }}
273273
password: ${{ secrets.DOCKER_PASSWORD }}
274274
dockerfile: docker/Dockerfile_ros-noetic

docker/Dockerfile_ros-kinetic

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,3 @@ RUN pip install argcomplete argparse catkin_pkg catkin-tools cerberus coverage \
5252

5353
# bootstrap rosdep
5454
RUN rosdep init && rosdep update
55-
56-
# create and start as LOCAL_USER_ID
57-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
58-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
59-
60-
CMD ["/bin/bash"]

docker/Dockerfile_ros-melodic

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,3 @@ RUN pip install argcomplete argparse catkin_pkg catkin-tools cerberus coverage \
4848

4949
# bootstrap rosdep
5050
RUN rosdep init && rosdep update
51-
52-
# create and start as LOCAL_USER_ID
53-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
54-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
55-
56-
CMD ["/bin/bash"]

docker/Dockerfile_ros-noetic

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,3 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6B
3939

4040
# bootstrap rosdep
4141
RUN rosdep init && rosdep update
42-
43-
# create and start as LOCAL_USER_ID
44-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
45-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
46-
47-
CMD ["/bin/bash"]

docker/Dockerfile_ros2-ardent

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@ ENV ROS_DISTRO ardent
1313
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
1414

1515
# setup sources.list
16-
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
17-
&& apt-get update
16+
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
1817

19-
# install ros2 desktop
20-
RUN apt-get install -y --quiet \
21-
libeigen3-dev \
18+
# install bootstrap tools
19+
RUN apt-get update \
20+
&& apt-get install --quiet -y \
2221
python3-colcon-common-extensions \
22+
python3-colcon-mixin \
2323
python3-vcstool \
24+
&& apt-get -y autoremove \
25+
&& apt-get clean autoclean \
26+
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27+
28+
# install ros2 desktop
29+
RUN apt-get install --quiet --no-install-recommends -y \
30+
libeigen3-dev \
2431
ros-$ROS_DISTRO-desktop \
2532
ros-$ROS_DISTRO-rosidl-generator-dds-idl \
2633
&& apt-get -y autoremove \
@@ -30,8 +37,6 @@ RUN apt-get install -y --quiet \
3037
# Install python 3 packages needed for testing
3138
RUN pip3 install --upgrade \
3239
argcomplete \
33-
colcon-common-extensions \
34-
colcon-mixin \
3540
flake8 \
3641
flake8-blind-except \
3742
flake8-builtins \
@@ -52,9 +57,3 @@ RUN colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mix
5257
&& colcon mixin update \
5358
&& colcon metadata add default https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml \
5459
&& colcon metadata update
55-
56-
# create and start as LOCAL_USER_ID
57-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
58-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
59-
60-
CMD ["/bin/bash"]

docker/Dockerfile_ros2-bouncy

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ ENV ROS_DISTRO bouncy
1313
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
1414

1515
# setup sources.list
16-
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
17-
&& apt-get update
16+
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
1817

19-
# install ros2 desktop
20-
RUN apt-get install -y --quiet \
18+
# install bootstrap tools
19+
RUN apt-get update \
20+
&& apt-get install --quiet -y \
2121
python3-colcon-common-extensions \
22+
python3-colcon-mixin \
2223
python3-vcstool \
24+
&& apt-get -y autoremove \
25+
&& apt-get clean autoclean \
26+
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27+
28+
# install ros2 desktop
29+
RUN apt-get install --quiet --no-install-recommends -y \
2330
ros-$ROS_DISTRO-desktop \
2431
ros-$ROS_DISTRO-rosidl-generator-dds-idl \
2532
&& apt-get -y autoremove \
@@ -29,8 +36,6 @@ RUN apt-get install -y --quiet \
2936
# Install Python 3 packages needed for testing
3037
RUN pip3 install --upgrade \
3138
argcomplete \
32-
colcon-common-extensions \
33-
colcon-mixin \
3439
flake8 \
3540
flake8-blind-except \
3641
flake8-builtins \
@@ -67,9 +72,3 @@ RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4
6772
&& gradle assemble \
6873
&& gradle install \
6974
&& rm -rf /tmp/*
70-
71-
# create and start as LOCAL_USER_ID
72-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
73-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
74-
75-
CMD ["/bin/bash"]

docker/Dockerfile_ros2-crystal

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ ENV ROS_DISTRO crystal
1313
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
1414

1515
# setup sources.list
16-
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
17-
&& apt-get update
16+
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
1817

19-
# install ros2 desktop
20-
RUN apt-get install -y --quiet \
18+
# install bootstrap tools
19+
RUN apt-get update \
20+
&& apt-get install --quiet -y \
2121
python3-colcon-common-extensions \
22+
python3-colcon-mixin \
2223
python3-vcstool \
24+
&& apt-get -y autoremove \
25+
&& apt-get clean autoclean \
26+
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27+
28+
# install ros2 desktop
29+
RUN apt-get install --quiet --no-install-recommends -y \
2330
ros-$ROS_DISTRO-desktop \
2431
ros-$ROS_DISTRO-ros2bag \
2532
ros-$ROS_DISTRO-rosidl-generator-dds-idl \
@@ -30,8 +37,6 @@ RUN apt-get install -y --quiet \
3037
# Install Python 3 packages needed for testing
3138
RUN pip3 install --upgrade \
3239
argcomplete \
33-
colcon-common-extensions \
34-
colcon-mixin \
3540
flake8 \
3641
flake8-blind-except \
3742
flake8-builtins \
@@ -61,9 +66,3 @@ RUN rm -rf /usr/local/include/fastrtps /usr/local/share/fastrtps /usr/local/lib/
6166
&& cmake -DBUILD_JAVA=ON -DTHIRDPARTY=ON -DSECURITY=ON .. \
6267
&& cmake --build . --target install -- -j $(nproc) \
6368
&& rm -rf /tmp/*
64-
65-
# create and start as LOCAL_USER_ID
66-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
67-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
68-
69-
CMD ["/bin/bash"]

docker/Dockerfile_ros2-dashing

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ ENV ROS_DISTRO dashing
1313
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
1414

1515
# setup sources.list
16-
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
17-
&& apt-get update
16+
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
1817

19-
# install ros2 desktop
20-
RUN apt-get install -y --quiet \
18+
# install bootstrap tools
19+
RUN apt-get update \
20+
&& apt-get install --quiet -y \
2121
python3-colcon-common-extensions \
22+
python3-colcon-mixin \
2223
python3-vcstool \
24+
&& apt-get -y autoremove \
25+
&& apt-get clean autoclean \
26+
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27+
28+
# install ros2 desktop
29+
RUN apt-get install --quiet --no-install-recommends -y \
2330
ros-$ROS_DISTRO-desktop \
2431
ros-$ROS_DISTRO-launch-testing-ament-cmake \
2532
ros-$ROS_DISTRO-ros2bag \
@@ -31,8 +38,6 @@ RUN apt-get install -y --quiet \
3138
# Install Python 3 packages needed for testing
3239
RUN pip3 install --upgrade \
3340
argcomplete \
34-
colcon-common-extensions \
35-
colcon-mixin \
3641
flake8 \
3742
flake8-blind-except \
3843
flake8-builtins \
@@ -53,9 +58,3 @@ RUN colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mix
5358
&& colcon mixin update \
5459
&& colcon metadata add default https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml \
5560
&& colcon metadata update
56-
57-
# create and start as LOCAL_USER_ID
58-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
59-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
60-
61-
CMD ["/bin/bash"]

docker/Dockerfile_ros2-eloquent

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ ENV ROS_DISTRO eloquent
1313
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
1414

1515
# setup sources.list
16-
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
17-
&& apt-get update
16+
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
1817

19-
# install ros2 desktop
20-
RUN apt-get install -y --quiet \
18+
# install bootstrap tools
19+
RUN apt-get update \
20+
&& apt-get install --quiet -y \
2121
python3-colcon-common-extensions \
22+
python3-colcon-mixin \
2223
python3-vcstool \
24+
&& apt-get -y autoremove \
25+
&& apt-get clean autoclean \
26+
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27+
28+
# install ros2 desktop
29+
RUN apt-get install --quiet --no-install-recommends -y \
2330
ros-$ROS_DISTRO-desktop \
2431
ros-$ROS_DISTRO-launch-testing-ament-cmake \
2532
ros-$ROS_DISTRO-ros2bag \
@@ -31,8 +38,6 @@ RUN apt-get install -y --quiet \
3138
# Install Python 3 packages needed for testing
3239
RUN pip3 install --upgrade \
3340
argcomplete \
34-
colcon-common-extensions \
35-
colcon-mixin \
3641
flake8 \
3742
flake8-blind-except \
3843
flake8-builtins \
@@ -70,9 +75,3 @@ RUN rm -rf /usr/local/include/fastrtps /usr/local/share/fastrtps /usr/local/lib/
7075
&& cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \
7176
&& cmake --build . --target install -- -j $(nproc) \
7277
&& rm -rf /tmp/*
73-
74-
# create and start as LOCAL_USER_ID
75-
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
76-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
77-
78-
CMD ["/bin/bash"]

docker/Dockerfile_ros2-foxy

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ ENV ROS_DISTRO foxy
1313
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
1414

1515
# setup sources.list
16-
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
17-
&& apt-get update
16+
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
1817

1918
# install bootstrap tools
20-
RUN apt-get update && apt-get install --no-install-recommends -y \
21-
git \
19+
RUN apt-get update \
20+
&& apt-get install --quiet -y \
2221
python3-colcon-common-extensions \
2322
python3-colcon-mixin \
2423
python3-rosdep \
@@ -28,8 +27,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2827
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
2928

3029
# install ros2 desktop
31-
RUN apt-get install -y --quiet \
32-
python3-vcstool \
30+
RUN apt-get install --quiet --no-install-recommends -y \
3331
ros-$ROS_DISTRO-desktop \
3432
ros-$ROS_DISTRO-launch-testing-ament-cmake \
3533
ros-$ROS_DISTRO-ros2bag \

0 commit comments

Comments
 (0)