Skip to content

Commit abc02e2

Browse files
committed
enable-vnc-for-watcloud-use
1 parent 875dc62 commit abc02e2

File tree

3 files changed

+93
-6
lines changed

3 files changed

+93
-6
lines changed

docker/Dockerfile.base

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ ENV DOCKER_USER_HOME=${DOCKER_USER_HOME_ARG}
3333
# Set environment variables
3434
ENV LANG=C.UTF-8
3535
ENV DEBIAN_FRONTEND=noninteractive
36+
ENV USER=root
37+
ENV DISPLAY=:1.0
3638

3739
USER root
3840

@@ -47,6 +49,23 @@ RUN --mount=type=cache,target=/var/cache/apt \
4749
apt -y autoremove && apt clean autoclean && \
4850
rm -rf /var/lib/apt/lists/*
4951

52+
# VNC dependencies
53+
RUN apt-get update -y
54+
RUN apt-get install -y supervisor
55+
RUN apt-get install -y x11vnc
56+
RUN apt-get install -y xvfb
57+
RUN apt-get install -y mesa-utils
58+
RUN apt-get install -y x11-apps
59+
RUN apt-get purge -y light-locker
60+
RUN apt-get install -y lxde
61+
62+
# Set up VNC
63+
COPY --chown=${USER} docker/supervisord.conf /etc/supervisor/supervisord.conf
64+
RUN chown -R ${USER}:${USER} /etc/supervisor
65+
RUN chmod 777 /var/log/supervisor/
66+
EXPOSE 5900
67+
CMD ["/usr/bin/supervisord"]
68+
5069
# Copy the Isaac Lab directory (files to exclude are defined in .dockerignore)
5170
COPY ../ ${ISAACLAB_PATH}
5271

docker/docker-compose.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes
3737
- type: bind
3838
source: ../source
3939
target: ${DOCKER_ISAACLAB_PATH}/source
40-
- type: bind
41-
source: ../scripts
42-
target: ${DOCKER_ISAACLAB_PATH}/scripts
4340
- type: bind
4441
source: ../docs
4542
target: ${DOCKER_ISAACLAB_PATH}/docs
@@ -64,6 +61,7 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes
6461
x-default-isaac-lab-environment: &default-isaac-lab-environment
6562
- ISAACSIM_PATH=${DOCKER_ISAACLAB_PATH}/_isaac_sim
6663
- OMNI_KIT_ALLOW_ROOT=1
64+
- DISPLAY=:1.0
6765

6866
x-default-isaac-lab-deploy: &default-isaac-lab-deploy
6967
resources:
@@ -91,10 +89,17 @@ services:
9189
container_name: isaac-lab-base
9290
environment: *default-isaac-lab-environment
9391
volumes: *default-isaac-lab-volumes
94-
network_mode: host
92+
network_mode: bridge
9593
deploy: *default-isaac-lab-deploy
94+
ports:
95+
- "5900:5900"
9696
# This is the entrypoint for the container
97-
entrypoint: bash
97+
entrypoint: >
98+
bash -c "
99+
Xvfb :1 -screen 0 1280x1024x24 -auth /tmp/.Xauthority &
100+
x11vnc -display :1 -auth /tmp/.Xauthority -nopw -forever -shared &
101+
startlxde &
102+
bash"
98103
stdin_open: true
99104
tty: true
100105

@@ -138,4 +143,4 @@ volumes:
138143
# isaac-lab
139144
isaac-lab-docs:
140145
isaac-lab-logs:
141-
isaac-lab-data:
146+
isaac-lab-data:

docker/supervisord.conf

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[supervisord]
2+
nodaemon=true
3+
logfile=/tmp/supervisord.log
4+
loglevel=error
5+
6+
[unix_http_server]
7+
file=/tmp/supervisor.sock ; (the path to the socket file)
8+
9+
[rpcinterface:supervisor]
10+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
11+
12+
[supervisorctl]
13+
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
14+
15+
[program:xvfb]
16+
priority=10
17+
command=/usr/bin/Xvfb :1 -screen 0 1440x1080x24
18+
autostart=true
19+
autorestart=true
20+
stopsignal=QUIT
21+
stdout_logfile=/tmp/xvfb.log
22+
redirect_stderr=true
23+
24+
[program:openbox]
25+
priority=15
26+
command=/usr/bin/openbox-session
27+
autostart=true
28+
autorestart=true
29+
stopsignal=QUIT
30+
environment=DISPLAY=":1"
31+
stdout_logfile=/tmp/openbox.log
32+
redirect_stderr=true
33+
34+
[program:lxpanel]
35+
priority=15
36+
command=/usr/bin/lxpanel --profile LXDE
37+
autostart=true
38+
autorestart=true
39+
stopsignal=QUIT
40+
environment=DISPLAY=":1"
41+
stdout_logfile=/tmp/lxpanel.log
42+
redirect_stderr=true
43+
44+
[program:pcmanfm]
45+
priority=15
46+
command=/usr/bin/pcmanfm --desktop --profile LXDE
47+
autostart=true
48+
autorestart=true
49+
stopsignal=QUIT
50+
environment=DISPLAY=":1"
51+
stdout_logfile=/tmp/pcmanfm.log
52+
53+
[program:x11vnc]
54+
priority=20
55+
command=x11vnc -display :1 -xkb -forever -shared -repeat
56+
autostart=true
57+
autorestart=true
58+
stopsignal=QUIT
59+
stdout_logfile=/tmp/x11vnc.log
60+
redirect_stderr=true
61+
62+
[group:vnc]
63+
programs=xvfb,openbox,lxpanel,pcmanfm,x11vnc

0 commit comments

Comments
 (0)