Skip to content

Commit

Permalink
feat: add docker compose for running images
Browse files Browse the repository at this point in the history
Adding docker compose helps standardising running images. It also
allows for easy integration with other tooling in the future (e.g.
devcontainers).

Still, backward compatibility is ensured by maintaining run-script
functionality.
  • Loading branch information
Wim-Peter Dirks committed Nov 1, 2024
1 parent 4b911bc commit 716fc5d
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 19 deletions.
60 changes: 60 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-FileCopyrightText: Alliander N. V.
#
# SPDX-License-Identifier: Apache-2.0

services:
franka:
image: franka
container_name: franka
network_mode: host
privileged: true
mem_limit: 6gb
volumes:
- "/tmp/.X11-unix:/tmp/.X11-unix"
- "${HOME}/.vscode-server:${HOME}/.vscode-server"
- "${HOME}/docker_ws:${HOME}/docker_ws"
- "/dev:/dev"
environment:
- "DISPLAY"
- "RCUTILS_COLORIZED_OUTPUT=1"
mobile_manipulator:
image: mobile_manipulator
container_name: mobile_manipulator
network_mode: host
privileged: true
mem_limit: 6gb
volumes:
- "/tmp/.X11-unix:/tmp/.X11-unix"
- "${HOME}/.vscode-server:${HOME}/.vscode-server"
- "${HOME}/docker_ws:${HOME}/docker_ws"
- "/dev/input:/dev/input"
environment:
- "DISPLAY"
- "RCUTILS_COLORIZED_OUTPUT=1"
panther:
image: panther
container_name: panther
network_mode: host
privileged: true
mem_limit: 6gb
volumes:
- "/tmp/.X11-unix:/tmp/.X11-unix"
- "${HOME}/.vscode-server:${HOME}/.vscode-server"
- "${HOME}/docker_ws:${HOME}/docker_ws"
- "/dev/input:/dev/input"
environment:
- "DISPLAY"
- "RCUTILS_COLORIZED_OUTPUT=1"
ros2:
image: ros2
container_name: ros2
network_mode: host
privileged: true
mem_limit: 6gb
volumes:
- "/tmp/.X11-unix:/tmp/.X11-unix"
- "${HOME}/.vscode-server:${HOME}/.vscode-server"
- "${HOME}/docker_ws:${HOME}/docker_ws"
environment:
- "DISPLAY"
- "RCUTILS_COLORIZED_OUTPUT=1"
21 changes: 2 additions & 19 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,11 @@ fi
mkdir -p ~/docker_ws
mkdir -p ~/.vscode-server

#If installed, launch the image with xhost:
#If installed, launch the image:
if $installed; then
printf 'Starting %s...\n\n' "$image"
docker compose run --rm $image

printf "Get acces to xhost...\n"
xhost +local:docker
printf "Done. \n\n"

docker run -it --privileged --rm \
--memory=6g \
--env DISPLAY \
--env RCUTILS_COLORIZED_OUTPUT=1 \
--network=host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /dev/input:/dev/input \
-v ~/.vscode-server:/home/"$USER"/.vscode-server \
-v ~/docker_ws:/home/"$USER"/docker_ws \
"$image"

printf "\nStop accces to xhost...\n"
xhost -local:docker
printf "Done.\n"
#If not installed, ask to install:
else
build=$(whiptail --title "Install?" \
Expand Down

0 comments on commit 716fc5d

Please sign in to comment.