Skip to content

Commit

Permalink
Merge pull request #3 from helix-robotics-ag/mx/remove_config_duplica…
Browse files Browse the repository at this point in the history
…tion_by_using_compose_consistently

Remove duplicated run_dev/run_prod configuration.
  • Loading branch information
sebtiburzio authored Feb 14, 2024
2 parents 92a5384 + 52c31e2 commit a3d00dd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

REPOSITORY_NAME="$(basename "$(dirname -- "$( readlink -f -- "$0"; )")")"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

docker build --progress=plain -t ghcr.io/helix-robotics-ag/${REPOSITORY_NAME}:iron .
docker compose -f $SCRIPT_DIR/docker-compose.yml build
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'

services:
ros-helix:
image: ghcr.io/helix-robotics-ag/ros-helix:iron
build:
context: .
dockerfile: Dockerfile
restart: always
network_mode: "host"
privileged: true
ipc: host
pid: host
environment:
- UID=${HOST_UID}
- ROS_DOMAIN_ID
command: su - ros --whitelist-environment=ROS_DOMAIN_ID /run.sh
20 changes: 8 additions & 12 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#!/bin/bash

REPOSITORY_NAME="$(basename "$(dirname -- "$( readlink -f -- "$0"; )")")"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

docker run -it --rm \
--network=host \
--ipc=host \
--pid=host \
--env UID=${MY_UID} \
--env ROS_DOMAIN_ID \
--privileged \
--volume ./helix_bringup:/colcon_ws/src/helix_bringup \
--volume ./helix_description:/colcon_ws/src/helix_description \
--volume ./dynamixel_hardware:/colcon_ws/src/dynamixel_hardware \
ghcr.io/helix-robotics-ag/${REPOSITORY_NAME}:iron
export HOST_UID=$(id -u)

docker compose -f $SCRIPT_DIR/docker-compose.yml run \
--volume $SCRIPT_DIR/helix_bringup:/colcon_ws/src/helix_bringup \
--volume $SCRIPT_DIR/helix_description:/colcon_ws/src/helix_description \
--volume $SCRIPT_DIR/dynamixel_hardware:/colcon_ws/src/dynamixel_hardware \
ros-helix bash

0 comments on commit a3d00dd

Please sign in to comment.