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

feat: Add ROS 2 Humble Dockerfile #56

Merged
merged 11 commits into from
Jul 29, 2022
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- ".github/workflows/deploy.yml"
schedule:
- cron: "7 4 * * 0" # Weekly on Sundays at 13:07 (JST)
workflow_dispatch:

env:
DOCKER_USERNAME: tiryoh
Expand All @@ -21,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ros-distro: [foxy, galactic, rolling]
ros-distro: [foxy, galactic, humble, rolling]
arch: [arm64, amd64]
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- ".github/workflows/test.yml"
schedule:
- cron: "0 2 * * 0" # Weekly on Sundays at 02:00
workflow_dispatch:

env:
DOCKER_USERNAME: tiryoh
Expand All @@ -19,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ros-distro: [foxy, galactic, rolling]
ros-distro: [foxy, galactic, humble, rolling]
arch: [arm64, amd64]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -55,7 +56,13 @@ jobs:
env:
DOCKER_TAGNAME: ${{ matrix.ros-distro }}-${{ matrix.arch }}
run: |
cd ${DOCKER_TAGNAME%-amd64} && docker build ${{ steps.docker-build-option.outputs.labels }} -t $DOCKER_USERNAME/$DOCKER_IMAGENAME:$DOCKER_TAGNAME .
if [[ -d ${DOCKER_TAGNAME%-amd64} ]]; then
cd ${DOCKER_TAGNAME%-amd64} && docker build ${{ steps.docker-build-option.outputs.labels }} -t $DOCKER_USERNAME/$DOCKER_IMAGENAME:$DOCKER_TAGNAME .
elif [[ -d ${DOCKER_TAGNAME%-arm64} ]]; then
cd ${DOCKER_TAGNAME%-arm64} && docker build ${{ steps.docker-build-option.outputs.labels }} -t $DOCKER_USERNAME/$DOCKER_IMAGENAME:$DOCKER_TAGNAME .
else
exit 1
fi

- name: List docker images
run: |
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Change the `shm-size` value depending on the situation.
docker run -p 6080:80 --shm-size=512m tiryoh/ros2-desktop-vnc:foxy
```

__NOTE__: `--security-opt seccomp=unconfined` flag is required to launch humble image. See https://github.com/Tiryoh/docker-ros2-desktop-vnc/pull/56.

```
docker run -p 6080:80 --shm-size=512m --security-opt seccomp=unconfined tiryoh/ros2-desktop-vnc:humble
```

Browse http://127.0.0.1:6080/.

![Image from Gyazo](https://i.gyazo.com/ab43ab3f6dc10b5186416499e49d0bbe.jpg)
Expand Down Expand Up @@ -54,12 +60,24 @@ cd foxy && docker build -t tiryoh/ros2-desktop-vnc:foxy .
cd galactic && docker build -t tiryoh/ros2-desktop-vnc:galactic .
```

* humble
```
cd humble && docker build -t tiryoh/ros2-desktop-vnc:humble .
```

* rolling
```
cd rolling && docker build -t tiryoh/ros2-desktop-vnc:rolling .
```

## Docker tags on hub.docker.com

* ~~[`dashing`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=dashing) which is based on [`dashing/Dockerfile`](./dashing/Dockerfile)~~ deprecated
* ~~[`eloquent`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=eloquent) which is based on [`eloquent/Dockerfile`](./eloquent/Dockerfile)~~ deprecated
* [`foxy`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=foxy), [`latest`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=latest) which is based on [`foxy/Dockerfile`](./foxy/Dockerfile)
* [`galactic`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=galactic) which is based on [`galactic/Dockerfile`](./galactic/Dockerfile)
* [`humble`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=humble) which is based on [`humble/Dockerfile`](./humble/Dockerfile)
* [`rolling`](https://hub.docker.com/r/tiryoh/ros2-desktop-vnc/tags?page=1&name=rolling) which is based on [`rolling/Dockerfile`](./rolling/Dockerfile)

Docker tags and build logs are listed on this page.
https://github.com/Tiryoh/docker-ros2-desktop-vnc/wiki
Expand Down
59 changes: 59 additions & 0 deletions humble-arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2020-2022 Tiryoh<[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM tiryoh/ubuntu-desktop-lxde-vnc:jammy
LABEL maintainer="Tiryoh<[email protected]>"

SHELL ["/bin/bash", "-c"]

RUN apt-get update -q && \
apt-get upgrade -yq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq wget curl git build-essential vim sudo lsb-release locales bash-completion tzdata gosu && \
rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --home-dir /home/ubuntu --shell /bin/bash --user-group --groups adm,sudo ubuntu && \
echo ubuntu:ubuntu | chpasswd && \
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

ARG ROS_DISTRO=humble
ARG INSTALL_PACKAGE=desktop

RUN apt-get update -q && \
apt-get install -y curl gnupg2 lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
python3-argcomplete \
python3-colcon-common-extensions \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*

# Install simulation package only on amd64
# Not ready for arm64 for now (July 28th, 2020)
# https://github.com/Tiryoh/docker-ros2-desktop-vnc/pull/56#issuecomment-1196359860
# RUN apt-get update -q && \
# apt-get install -y \
# ros-${ROS_DISTRO}-gazebo-ros-pkgs \
# ros-${ROS_DISTRO}-ros-ign && \
# rm -rf /var/lib/apt/lists/*

RUN gosu ubuntu rosdep update && \
grep -F "source /opt/ros/${ROS_DISTRO}/setup.bash" /home/ubuntu/.bashrc || echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/ubuntu/.bashrc && \
sudo chown ubuntu:ubuntu /home/ubuntu/.bashrc

RUN echo 'sed -i -e "s/palette_color_4=rgb([0-9,]*)/palette_color_4=rgb(51,61,255)/g" $HOME/.config/lxterminal/lxterminal.conf' > /usr/local/bin/update-lxterminal.sh && \
chmod +x /usr/local/bin/update-lxterminal.sh

ENV USER ubuntu
59 changes: 59 additions & 0 deletions humble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2020-2022 Tiryoh<[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM tiryoh/ubuntu-desktop-lxde-vnc:jammy
LABEL maintainer="Tiryoh<[email protected]>"

SHELL ["/bin/bash", "-c"]

RUN apt-get update -q && \
apt-get upgrade -yq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq wget curl git build-essential vim sudo lsb-release locales bash-completion tzdata gosu && \
rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --home-dir /home/ubuntu --shell /bin/bash --user-group --groups adm,sudo ubuntu && \
echo ubuntu:ubuntu | chpasswd && \
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

ARG ROS_DISTRO=humble
ARG INSTALL_PACKAGE=desktop

RUN apt-get update -q && \
apt-get install -y curl gnupg2 lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
python3-argcomplete \
python3-colcon-common-extensions \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*

# Install simulation package only on amd64
# Not ready for arm64 for now (July 28th, 2020)
# https://github.com/Tiryoh/docker-ros2-desktop-vnc/pull/56#issuecomment-1196359860
RUN apt-get update -q && \
apt-get install -y \
ros-${ROS_DISTRO}-gazebo-ros-pkgs \
ros-${ROS_DISTRO}-ros-ign && \
rm -rf /var/lib/apt/lists/*

RUN gosu ubuntu rosdep update && \
grep -F "source /opt/ros/${ROS_DISTRO}/setup.bash" /home/ubuntu/.bashrc || echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/ubuntu/.bashrc && \
sudo chown ubuntu:ubuntu /home/ubuntu/.bashrc

RUN echo 'sed -i -e "s/palette_color_4=rgb([0-9,]*)/palette_color_4=rgb(51,61,255)/g" $HOME/.config/lxterminal/lxterminal.conf' > /usr/local/bin/update-lxterminal.sh && \
chmod +x /usr/local/bin/update-lxterminal.sh

ENV USER ubuntu