Skip to content

Instantly share code, notes, and snippets.

@marijnvdwerf
Created January 6, 2022 20:05
Show Gist options
  • Save marijnvdwerf/6a65f7dc5a618f593b4776e478f99d6f to your computer and use it in GitHub Desktop.
Save marijnvdwerf/6a65f7dc5a618f593b4776e478f99d6f to your computer and use it in GitHub Desktop.
  1. Install Xquartz and socat
brew install socat    
brew install --cask xquartz  
defaults write org.xquartz.X11 enable_iglx -bool true  
defaults write org.xquartz.X11 nolisten_tcp -bool false
  1. Reboot

  2. Run script

docker build -t openloco-x11 .   
(in another terminal) socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
./run.sh
FROM ubuntu:18.04
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get install --no-install-recommends -y \
clang \
cmake \
g++-multilib \
gcc-multilib \
git \
libpng-dev:i386 \
libsdl2-dev:i386 \
libsdl2-mixer-dev:i386 \
libyaml-cpp-dev:i386 \
ninja-build \
pkg-config:i386 \
&& apt-get clean
RUN apt-get update \
&& apt-get install -y \
ssh \
rsync \
gdb \
&& apt-get clean
VOLUME /opt/locomotion
RUN ( \
echo 'LogLevel DEBUG2'; \
echo 'PermitRootLogin yes'; \
echo 'PasswordAuthentication yes'; \
echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \
) > /etc/ssh/sshd_config_test_clion \
&& mkdir /run/sshd
RUN useradd -m user \
&& yes password | passwd user
RUN usermod -s /bin/bash user
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]
#!/usr/bin/env bash
docker stop clion_remote_env
docker rm clion_remote_env
# docker build -t openloco-x11 .
docker run -d \
--cap-add sys_ptrace \
--security-opt seccomp=unconfined \
-p2233:22 \
-e DISPLAY=host.docker.internal:0 \
-v ~/Downloads/gog-loco:/opt/locomotion \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--name clion_remote_env openloco-x11
ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2233"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment