-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
ARG ROS_DISTRO | ||
ARG ROS_DISTRO=humble | ||
|
||
FROM ros:${ROS_DISTRO}-ros-core | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ros-${ROS_DISTRO}-joy-linux \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ros_entrypoint.sh . | ||
|
||
ENV LAUNCH_COMMAND='ros2 run joy_linux joy_linux_node' | ||
|
||
RUN echo 'alias run="su - ros --whitelist-environment=\"ROS_DOMAIN_ID\" /run.sh"' >> /etc/bash.bashrc && \ | ||
echo "source /opt/ros/$ROS_DISTRO/setup.bash; echo UID: $UID; echo ROS_DOMAIN_ID: $ROS_DOMAIN_ID; $LAUNCH_COMMAND" >> /run.sh && chmod +x /run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
docker build -t ghcr.io/rosblox/ros-joy-linux:humble . | ||
#!/bin/bash | ||
|
||
export BUILDKIT_PROGRESS=plain | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
docker compose -f $SCRIPT_DIR/docker-compose.yml build docker build -t ghcr.io/rosblox/ros-joy-linux:humble . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
services: | ||
ros-joy-linux: | ||
image: ghcr.io/rosblox/ros-joy-linux:humble | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
restart: always | ||
network_mode: "host" | ||
ipc: host | ||
pid: host | ||
volumes: | ||
- /dev/input:/dev/input | ||
environment: | ||
- UID=${HOST_UID} | ||
- ROS_DOMAIN_ID | ||
command: su - ros --whitelist-environment=ROS_DOMAIN_ID /run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
id -u ros &>/dev/null || adduser --quiet --disabled-password --gecos '' --uid ${UID:=1000} ros | ||
|
||
source /opt/ros/${ROS_DISTRO}/setup.bash | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
REPOSITORY_NAME="$(basename "$(dirname -- "$( readlink -f -- "$0"; )")")" | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
export HOST_UID=$(id -u) | ||
|
||
docker compose -f $SCRIPT_DIR/docker-compose.yml run \ | ||
${REPOSITORY_NAME} bash |