Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dockerfile for jsk_visualization #767

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG ROS_DISTRO
ARG UBUNTU_VERSION
FROM osrf/ros:${ROS_DISTRO}-desktop-${UBUNTU_VERSION}

RUN echo "deb http://packages.ros.org/ros-testing/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list
RUN apt-get update && apt-get install -y wget git
RUN wget http://packages.ros.org/ros.key -O - | apt-key add -

RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \
python-catkin-tools \
python-pip \
python-rosdep \
python-setuptools \
python-wstool

RUN pip install 'pip==9.0.3' && \
pip install 'setuptools==44.1.0'

ARG ROS_DISTRO
RUN cd ~ && \
mkdir -p ros/${ROS_DISTRO}/src && \
cd ros/${ROS_DISTRO}/src && \
wstool init && \
wstool set jsk-ros-pkg/jsk_visualization https://github.com/jsk-ros-pkg/jsk_visualization.git -v master --git -y && \
wstool up -j 2

RUN rosdep update --include-eol-distros

# /opt/ros/${ROS_DISTRO}/share can be changed after rosdep install, so we run it 3 times.
RUN for i in $(seq 3); do rosdep install --rosdistro ${ROS_DISTRO} -r -y -i --from-paths /opt/ros/${ROS_DISTRO}/share ~/ros/${ROS_DISTRO}/src; done

RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
cd ~/ros/${ROS_DISTRO} && \
catkin build; \
10 changes: 10 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# docker for jsk_visualization

## Usage

```
# melodic
docker build --build-arg ROS_DISTRO=melodic --build-arg UBUNTU_VERSION=bionic -t jskrobotics/jsk_visualization:melodic-latest .
# kinetic
docker build --build-arg ROS_DISTRO=kinetic --build-arg UBUNTU_VERSION=xenial -t jskrobotics/jsk_visualization:kinetic-latest .
```
16 changes: 16 additions & 0 deletions docker/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -eu

[[ ${DOCKER_TAG} =~ ([a-z]+)-([0-9a-z.]+)$ ]]
ROS_DISTRO=${BASH_REMATCH[1]};

if [[ ${ROS_DISTRO} = "kinetic" ]]; then
UBUNTU_VERSION="xenial";
elif [[ ${ROS_DISTRO} = "indigo" ]]; then
UBUNTU_VERSION="trusty";
fi

docker build --build-arg ROS_DISTRO=${ROS_DISTRO} \
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
-t ${IMAGE_NAME} .