Fix gui start, change docker container, add shell to start gui
This commit is contained in:
@@ -26,13 +26,14 @@ docker build -f exwayz_test.dockerfile -t exwayz_test:latest .
|
|||||||
Run the container (example; adjust mounts and environment for your platform):
|
Run the container (example; adjust mounts and environment for your platform):
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
# Example (PowerShell+WSL on systems with X11 forwarding available)
|
# Example (WSL on systems with X11 forwarding available)
|
||||||
docker run -it --rm \
|
docker run -it --rm \
|
||||||
--env="DISPLAY=$env:DISPLAY" \
|
--env="DISPLAY=$DISPLAY" \
|
||||||
--env="QT_X11_NO_MITSHM=1" \
|
--env="QT_X11_NO_MITSHM=1" \
|
||||||
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
|
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
|
||||||
-v "${PWD}:/app" \
|
-v "${PWD}:/app" \
|
||||||
exwayz_test:latest
|
exwayz_test:latest \
|
||||||
|
/bin/bash
|
||||||
```
|
```
|
||||||
|
|
||||||
On POSIX shells use `$DISPLAY` and `$(pwd)` as usual.
|
On POSIX shells use `$DISPLAY` and `$(pwd)` as usual.
|
||||||
|
|||||||
@@ -4,14 +4,23 @@ FROM ros:jazzy-ros-core
|
|||||||
# Build argument provided by buildx/BuildKit: `TARGETARCH` (amd64, arm64, etc.).
|
# Build argument provided by buildx/BuildKit: `TARGETARCH` (amd64, arm64, etc.).
|
||||||
# Default to amd64 when not provided.
|
# Default to amd64 when not provided.
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH=amd64
|
||||||
|
ARG GRAPICAL_ENV=TRUE
|
||||||
|
|
||||||
# Copy both architecture-specific packages into the image and choose the right one at build time
|
# Copy both architecture-specific packages into the image and choose the right one at build time
|
||||||
COPY pkgs/exwayz_3d_mapping-1.2.2-linux-u24.04-amd64.deb /tmp/exwayz_amd64.deb
|
COPY pkgs/exwayz_3d_mapping-1.2.2-linux-u24.04-amd64.deb /tmp/exwayz_amd64.deb
|
||||||
COPY pkgs/exwayz_3d_mapping-1.2.2-linux-u24.04-aarch64.deb /tmp/exwayz_aarch64.deb
|
COPY pkgs/exwayz_3d_mapping-1.2.2-linux-u24.04-aarch64.deb /tmp/exwayz_aarch64.deb
|
||||||
|
|
||||||
|
# Install dependencies and setup for GUI applications
|
||||||
|
ENV DISPLAY=:0
|
||||||
|
ENV WAYLAND_DISPLAY=wayland-0
|
||||||
|
ENV XDG_SESSION_TYPE=x11
|
||||||
|
ENV XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir
|
||||||
#If debug, install the following:
|
#If debug, install the following:
|
||||||
RUN apt update && apt install -y libgl1-mesa-dev libosmesa6-dev libglew-dev libgles2-mesa-dev libglfw3-dev libstdc++6 mesa-utils
|
RUN if [ "$GRAPHICAL_ENV" = "TRUE" ]; then \
|
||||||
#TODO we're installing unneccessary things like the humanity-icons package, clean this up later.
|
apt update && apt install -y libgl1-mesa-dev libosmesa6-dev libglew-dev libgles2-mesa-dev libglfw3-dev libstdc++6 mesa-utils; \
|
||||||
|
fi
|
||||||
|
#TODO we're installing unneccessary things like the humanity-icons package, clean this up later.
|
||||||
|
|
||||||
|
|
||||||
# RUN --mount=type=secret,id=exwayz_license set -eux; \
|
# RUN --mount=type=secret,id=exwayz_license set -eux; \
|
||||||
# if [ "${TARGETARCH}" = "aarch64" ]; then \
|
# if [ "${TARGETARCH}" = "aarch64" ]; then \
|
||||||
@@ -27,18 +36,22 @@ RUN apt update && apt install -y libgl1-mesa-dev libosmesa6-dev libglew-dev libg
|
|||||||
# rm -f /tmp/exwayz_amd64.deb /tmp/exwayz_aarch64.deb; \
|
# rm -f /tmp/exwayz_amd64.deb /tmp/exwayz_aarch64.deb; \
|
||||||
# rm -rf /var/lib/apt/lists/*
|
# rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN --mount=type=secret,id=exwayz_license set -eux; \
|
COPY licenses/exwayz_liscence.lic /tmp/exwayz_license
|
||||||
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -fy /tmp/exwayz_amd64.deb; \
|
apt-get install -fy /tmp/exwayz_amd64.deb; \
|
||||||
if [ -s /run/secrets/exwayz_license ]; then \
|
if [ -f /tmp/exwayz_license ]; then \
|
||||||
exwayz_license --query "$(cat /run/secrets/exwayz_license)" || true; \
|
exwayz_license --query "$(cat /tmp/exwayz_license)" || true; \
|
||||||
else \
|
else \
|
||||||
echo "No license file provided"; \
|
echo "No license file provided"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
rm -f /tmp/exwayz_amd64.deb /tmp/exwayz_aarch64.deb; \
|
rm -f /tmp/exwayz_amd64.deb /tmp/exwayz_aarch64.deb; \
|
||||||
|
rm -f /tmp/exwayz_license; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
# TODO verify license was applied successfully
|
|
||||||
|
# # Change the working directory to /app
|
||||||
|
# WORKDIR /app
|
||||||
|
|
||||||
# Set entrypoint
|
# Set entrypoint
|
||||||
ENTRYPOINT ["/ros_entrypoint.sh"]
|
ENTRYPOINT ["/ros_entrypoint.sh"]
|
||||||
|
|||||||
17
src/start_docker_wsl_GUI.sh
Normal file
17
src/start_docker_wsl_GUI.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Setup WSLg environment variables for GUI applications
|
||||||
|
echo "🚀 Setting up WSLg environment variables for GUI support..."
|
||||||
|
export DISPLAY=:0
|
||||||
|
export WAYLAND_DISPLAY=wayland-0
|
||||||
|
export XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir
|
||||||
|
|
||||||
|
echo "✅ DISPLAY is set to $DISPLAY"
|
||||||
|
|
||||||
|
|
||||||
|
echo "🐳 Starting Docker container with GUI support..."
|
||||||
|
docker run -it --rm \
|
||||||
|
--env="DISPLAY=$DISPLAY" \
|
||||||
|
--env="QT_X11_NO_MITSHM=1" \
|
||||||
|
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
|
||||||
|
-v "${PWD}:/app" \
|
||||||
|
exwayz_test:latest \
|
||||||
|
/bin/bash
|
||||||
Reference in New Issue
Block a user