Skip to content

Commit

Permalink
Merge pull request #2 from helix-robotics-ag/seb/remove_config_duplic…
Browse files Browse the repository at this point in the history
…ation_by_using_compose_consistently

Remove duplicated run_dev/run_prod configuration.
  • Loading branch information
sebtiburzio authored Feb 15, 2024
2 parents ec8c92b + f7616f5 commit 4f5c197
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 4f5c197

Please sign in to comment.