Skip to content

Commit

Permalink
Remove duplicated run config
Browse files Browse the repository at this point in the history
  • Loading branch information
sebtiburzio committed Feb 14, 2024
1 parent ec8c92b commit f7616f5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 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
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'

services:
ros-foxglove-bridge:
image: ghcr.io/helix-robotics-ag/ros-foxglove-bridge:iron
build:
context: .
dockerfile: Dockerfile
restart: always
network_mode: "host"
ipc: host
pid: host
environment:
- UID=${HOST_UID}
- ROS_DOMAIN_ID
command: su - ros --whitelist-environment=ROS_DOMAIN_ID /run.sh
14 changes: 5 additions & 9 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/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 \
ghcr.io/helix-robotics-ag/${REPOSITORY_NAME}:iron
export HOST_UID=$(id -u)

docker compose -f $SCRIPT_DIR/docker-compose.yml run \
ros-foxglove-bridge bash

0 comments on commit f7616f5

Please sign in to comment.