Skip to content

Commit

Permalink
Merge pull request #29 from robotology/fix/gitpod-vscode
Browse files Browse the repository at this point in the history
Fix X11 problems after changes to Gitpod UI
  • Loading branch information
pattacini authored Apr 7, 2021
2 parents afef577 + dfd1406 commit d50b8c9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 27 deletions.
10 changes: 4 additions & 6 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ USER root

# Set up script to prepare /workspace/iCubContrib
COPY init-icubcontrib.sh /usr/bin/init-icubcontrib.sh
COPY init-icubcontrib-local.sh /usr/bin/init-icubcontrib-local.sh
RUN chmod +x /usr/bin/init-icubcontrib.sh /usr/bin/init-icubcontrib-local.sh && \
dos2unix /usr/bin/init-icubcontrib.sh /usr/bin/init-icubcontrib-local.sh
RUN chmod +x /usr/bin/init-icubcontrib.sh && \
dos2unix /usr/bin/init-icubcontrib.sh

# Set up script to launch graphics and vnc
COPY start-vnc-session.sh /usr/bin/start-vnc-session.sh
COPY start-vnc-session-local.sh /usr/bin/start-vnc-session-local.sh
RUN chmod +x /usr/bin/start-vnc-session.sh /usr/bin/start-vnc-session-local.sh && \
dos2unix /usr/bin/start-vnc-session.sh /usr/bin/start-vnc-session-local.sh
RUN chmod +x /usr/bin/start-vnc-session.sh && \
dos2unix /usr/bin/start-vnc-session.sh

# Manage x11vnc port
EXPOSE 5901
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ To run the sandbox locally using [Docker](https://docs.docker.com/get-docker), g
```
1. From within the container shell, launch the following scripts:
```sh
$ init-icubcontrib-local.sh
$ start-vnc-session-local.sh
$ init-icubcontrib.sh
$ start-vnc-session.sh
```
1. Clone and install the project:
```sh
Expand Down
9 changes: 0 additions & 9 deletions dockerfiles/init-icubcontrib-local.sh

This file was deleted.

2 changes: 2 additions & 0 deletions dockerfiles/init-icubcontrib.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
sudo chown -R gitpod.gitpod /workspace
mkdir -p /workspace/iCubContrib
git clone https://github.com/robotology/icub-contrib-common.git --depth 1 /workspace/icub-contrib-common
mkdir -p /workspace/icub-contrib-common/build
cd /workspace/icub-contrib-common/build
cmake .. -DCMAKE_INSTALL_PREFIX=/workspace/iCubContrib
make install
rm -Rf /workspace/icub-contrib-common
cd -
6 changes: 0 additions & 6 deletions dockerfiles/start-vnc-session-local.sh

This file was deleted.

8 changes: 4 additions & 4 deletions dockerfiles/start-vnc-session.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkill -9 -f "vnc" && pkill -9 -f "xf" && pkill -9 Xorg
rm -f /tmp/.X1-lock
nohup X ${DISPLAY} -config /etc/X11/xorg.conf > /dev/null 2>&1 &
pkill -9 -f "vnc" && pkill -9 -f "xf" && sudo pkill -9 Xorg
sudo rm -f /tmp/.X1-lock
sudo nohup X ${DISPLAY} -config /etc/X11/xorg.conf > /dev/null 2>&1 &
nohup startxfce4 > /dev/null 2>&1 &
nohup x11vnc -localhost -display ${DISPLAY} -N -forever -shared -bg > /dev/null 2>&1
nohup /opt/novnc/utils/launch.sh --web /opt/novnc --vnc localhost:5901 --listen 6080 > /dev/null 2>&1 &
nohup /opt/novnc/utils/launch.sh --web /opt/novnc --vnc localhost:5901 --listen 6080 > /dev/null 2>&1 &

0 comments on commit d50b8c9

Please sign in to comment.