Compare commits
7 Commits
245b5325e6
...
4239391ab7
| Author | SHA1 | Date | |
|---|---|---|---|
| 4239391ab7 | |||
| 420184e733 | |||
| 5f760e47ea | |||
| f34088a1e7 | |||
|
|
ab21b4c285 | ||
|
|
2ddbf88d8b | ||
|
|
f1d6d516d1 |
@ -1,5 +1,5 @@
|
||||
ARG ROS=humble
|
||||
FROM osrf/ros:${ROS}-desktop
|
||||
FROM osrf/ros:${ROS}-desktop-full
|
||||
|
||||
#SSH (First to hopefully keep keys, even on modification.)
|
||||
RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/lists/*
|
||||
@ -7,11 +7,11 @@ RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/l
|
||||
#OpenGL
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri libglvnd0 libgl1 libglx0 libegl1 libxext6 libx11-6 && rm -rf /var/lib/apt/lists/*
|
||||
#Vulkan
|
||||
RUN apt-get update && apt-get install -y libvulkan1 mesa-vulkan-drivers vulkan-utils mesa-utils && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install -y libvulkan1 mesa-vulkan-drivers vulkan-tools mesa-utils && rm -rf /var/lib/apt/lists/*
|
||||
#Utils
|
||||
RUN apt-get update && apt-get install -y git ninja-build git bash-completion clangd-12 && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install -y gdb clang-format git ninja-build git bash-completion clangd ccls && rm -rf /var/lib/apt/lists/*
|
||||
#Rosdeps
|
||||
RUN apt-get update && apt-get install -y git ros-galactic-ament-cmake ros-galactic-moveit ros-galactic-behaviortree-cpp-v3 ros-galactic-ros-ign-gazebo && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install -y ros-humble-ament-cmake ros-humble-moveit ros-humble-behaviortree-cpp-v3 ros-humble-gazebo-ros ros-humble-ros-gz-sim ros-humble-ros2-control ros-humble-gazebo-ros2-control ros-humble-ros2-controllers ros-humble-moveit-ros-control-interface && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /run/sshd
|
||||
|
||||
|
||||
@ -30,7 +30,10 @@ fi
|
||||
|
||||
echo "ros:ros" | chpasswd
|
||||
su ros -c "printf 'source /opt/ros/$ROS_DISTRO/setup.bash\nsource /home/ros/workspace/install/setup.bash' > ~/.rosrc"
|
||||
printf "DISPLAY=$DISPLAY" > /etc/profile.d/display.sh
|
||||
printf "export DISPLAY=$DISPLAY" > /etc/profile.d/display.sh
|
||||
printf "export XAUTHORITY=$XAUTHORITY" > /etc/profile.d/xauth.sh
|
||||
chmod +x /etc/profile.d/display.sh
|
||||
chmod +x /etc/profile.d/xauth.sh
|
||||
|
||||
echo "Ready to connect."
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ services:
|
||||
build:
|
||||
context: ./build_ros
|
||||
args:
|
||||
ROS: galactic #Desired ROS version
|
||||
ROS: humble #Desired ROS version
|
||||
volumes:
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix:rw
|
||||
- ./home:/home/ros
|
||||
|
||||
25
start.sh
25
start.sh
@ -1,9 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd $(dirname "$0")
|
||||
if [[ "$EUID" = 0 ]]; then
|
||||
printf "Please run as user. I will invoke sudo when needed."
|
||||
exit
|
||||
fi
|
||||
|
||||
pushd "$(dirname "$0")" || exit
|
||||
|
||||
if [ ! -d "home" ]; then
|
||||
mkdir $(dirname "$0")/home
|
||||
mkdir home
|
||||
fi
|
||||
|
||||
if [ ! -d "home/.ssh" ]; then
|
||||
@ -15,23 +20,23 @@ grep -sqF -- "$ident" "home/.ssh/authorized_keys" || echo "$ident" >> "home/.ssh
|
||||
|
||||
sudo docker-compose down
|
||||
|
||||
echo U_ID="$(id -u)" > $(dirname "$0")/.env
|
||||
echo G_ID="$(id -g)" >> $(dirname "$0")/.env
|
||||
echo U_ID="$(id -u)" > "$(dirname "$0")/.env"
|
||||
echo G_ID="$(id -g)" >> "$(dirname "$0")/.env"
|
||||
|
||||
sudo U_ID="$(id -u)" G_ID="$(id -g)" docker-compose build
|
||||
sudo U_ID="$(id -u)" G_ID="$(id -g)" docker-compose up -d
|
||||
|
||||
up_result=$(sudo docker-compose ps -q)
|
||||
up_result="$(sudo docker-compose ps -q)"
|
||||
|
||||
hosts=()
|
||||
|
||||
while read line; do
|
||||
hosts+=(`sudo docker inspect --format='{{ .Config.Hostname }}' $line`)
|
||||
while read -r line; do
|
||||
hosts+=("$(sudo docker inspect --format='{{ .Config.Hostname }}' "$line")")
|
||||
#xhost +local:`sudo docker inspect --format='{{ .Config.Hostname }}' $line`
|
||||
done <<< "$up_result"
|
||||
|
||||
echo "Adding to xhost:"
|
||||
for host in ${hosts[@]}; do
|
||||
for host in "${hosts[@]}"; do
|
||||
echo " + $host"
|
||||
xhost "+local:$host"
|
||||
done
|
||||
@ -40,9 +45,9 @@ echo "Attaching."
|
||||
sudo docker-compose up
|
||||
|
||||
echo "Removing from xhost:"
|
||||
for host in ${hosts[@]}; do
|
||||
for host in "${hosts[@]}"; do
|
||||
echo " - $host"
|
||||
xhost "-local:$host"
|
||||
done
|
||||
|
||||
popd
|
||||
popd || exit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user