Skip to content

Commit

Permalink
Accept ros distro as argument in Dockerfile (#412)
Browse files Browse the repository at this point in the history
* Accept ros distro as argument in Dockerfile

* /opt/ros is already sourced by ~/.bashrc

* (actions) pass ros_distro to docker build

* (actions) [temp] remove noetic

Waiting for release of tf2_web_republisher
  • Loading branch information
MatthijsBurgh committed Jun 20, 2021
1 parent 170f1d3 commit bcdffa3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -9,12 +9,12 @@ jobs:
strategy:
fail-fast: false
matrix:
ros_distro: [kinetic, melodic, noetic]
ros_distro: [kinetic, melodic] # Temp remove noetic waitng for release of tf2_web_republisher
steps:
- uses: actions/checkout@v2
- name: Docker pull
run: docker pull ros:${{ matrix.ros_distro }}-ros-core
- name: Docker build
run: docker build -t roslibjsdocker .
run: docker build --build-arg ROS_DISTRO="${{ matrix.ros_distro }}" -t roslibjsdocker .
- name: Tests
run: docker run -v $(pwd):/root/roslibjs --rm roslibjsdocker bash -i -c 'bash /root/roslibjs/test/build.bash'
9 changes: 4 additions & 5 deletions Dockerfile
@@ -1,16 +1,15 @@
FROM ros:kinetic-ros-core
ARG ROS_DISTRO=melodic
FROM ros:$ROS_DISTRO-ros-core

ENV ROS_DISTRO=kinetic
# Dependencies for rosbridge
RUN apt update && apt-get install -y xvfb firefox git wget ros-$ROS_DISTRO-rosbridge-server ros-$ROS_DISTRO-tf2-web-republisher ros-$ROS_DISTRO-common-tutorials ros-$ROS_DISTRO-rospy-tutorials ros-$ROS_DISTRO-actionlib-tutorials

# Install nvm, Node.js and node-gyp
ENV NODE_VERSION v10.15.0
ENV NODE_VERSION=v10.15.0
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash \
&& . $HOME/.nvm/nvm.sh \
&& nvm install $NODE_VERSION && nvm alias default $NODE_VERSION \
&& npm install -g node-gyp

RUN echo "source /opt/ros/kinetic/setup.bash" >> $HOME/.bashrc
RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> $HOME/.bashrc
ENV PATH /bin/versions/node/$NODE_VERSION/bin:$PATH

1 change: 0 additions & 1 deletion test/build.bash
Expand Up @@ -23,7 +23,6 @@ pushd $(dirname $0) > /dev/null
#sh -e /etc/init.d/xvfb start
#Xvfb :99 -ac &

source /opt/ros/kinetic/setup.bash
sh examples/setup_examples.sh

rostopic list
Expand Down

0 comments on commit bcdffa3

Please sign in to comment.