Skip to content

Commit 0e8a108

Browse files
committed
Follow new structure.
1 parent a770f0a commit 0e8a108

File tree

6 files changed

+51
-6
lines changed

6 files changed

+51
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@ jobs:
3232
context: .
3333
platforms: linux/amd64,linux/arm64
3434
push: true
35-
build-args: |
36-
ROS_DISTRO=humble
37-
tags: ghcr.io/rosblox/${{ github.event.repository.name }}:humble
35+
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:humble

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
ARG ROS_DISTRO
1+
ARG ROS_DISTRO=humble
22

33
FROM ros:${ROS_DISTRO}-ros-core
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
66
ros-${ROS_DISTRO}-joy-linux \
7-
&& rm -rf /var/lib/apt/lists/*
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
COPY ros_entrypoint.sh .
10+
11+
ENV LAUNCH_COMMAND='ros2 run joy_linux joy_linux_node'
12+
13+
RUN echo 'alias run="su - ros --whitelist-environment=\"ROS_DOMAIN_ID\" /run.sh"' >> /etc/bash.bashrc && \
14+
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

build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
docker build -t ghcr.io/rosblox/ros-joy-linux:humble .
1+
#!/bin/bash
2+
3+
export BUILDKIT_PROGRESS=plain
4+
5+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
7+
docker compose -f $SCRIPT_DIR/docker-compose.yml build docker build -t ghcr.io/rosblox/ros-joy-linux:humble .

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
ros-joy-linux:
3+
image: ghcr.io/rosblox/ros-joy-linux:humble
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
restart: always
8+
network_mode: "host"
9+
ipc: host
10+
pid: host
11+
volumes:
12+
- /dev/input:/dev/input
13+
environment:
14+
- UID=${HOST_UID}
15+
- ROS_DOMAIN_ID
16+
command: su - ros --whitelist-environment=ROS_DOMAIN_ID /run.sh

ros_entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
4+
id -u ros &>/dev/null || adduser --quiet --disabled-password --gecos '' --uid ${UID:=1000} ros
5+
6+
source /opt/ros/${ROS_DISTRO}/setup.bash
7+
8+
exec "$@"

run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
REPOSITORY_NAME="$(basename "$(dirname -- "$( readlink -f -- "$0"; )")")"
4+
5+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
7+
export HOST_UID=$(id -u)
8+
9+
docker compose -f $SCRIPT_DIR/docker-compose.yml run \
10+
${REPOSITORY_NAME} bash

0 commit comments

Comments
 (0)