From 89a002f48025003947c4068d035701d6c08ecffe Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Sat, 18 Mar 2023 19:14:16 +0100 Subject: [PATCH] add gui-container, rathole, snowflake --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++ gui-container/Dockerfile | 28 ++++++++++++++++++++++++ rathole/Dockerfile | 16 ++++++++++++++ snowflake/Dockerfile | 22 +++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 gui-container/Dockerfile create mode 100644 rathole/Dockerfile create mode 100644 snowflake/Dockerfile diff --git a/README.md b/README.md index 58a64e7..9c777c5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,49 @@ # Containers-Workspace Various useful and useless Dockerfiles, often experimental and work in progress + +## gui-container + +gui-container is an experiment for apps with GUI + +how to run with default, permissive options: + +```bash +podman run --privileged -it \ + -e XDG_RUNTIME_DIR=/runtime_dir \ + -e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \ + -e DISPLAY="$DISPLAY" \ + -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ + -v $HOME/.Xauthority:/root/.Xauthority:ro \ + -v "$XDG_RUNTIME_DIR:/runtime_dir:rw" \ + --entrypoint bash \ + --name "gui_container" \ + gui-container:latest +``` + +starting dbus: + +```bash +export $(dbus-launch) +``` + +unsetting `WAYLAD_DISPLAY` or `DISPLAY` can force apps to use the other one + +```bash +unset DISPLAY +# or +unset WAYLAD_DISPLAY +``` + +to mage Qt-based apps work: + +```bash +export QT_QPA_PLATFORM=wayland +``` + +## rathole + +Compiled from source [rathole](https://github.com/rapiz1/rathole) image. + +## snowflake + +Compiled from source [torproject snowflake](https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake) image. diff --git a/gui-container/Dockerfile b/gui-container/Dockerfile new file mode 100644 index 0000000..729c6da --- /dev/null +++ b/gui-container/Dockerfile @@ -0,0 +1,28 @@ +FROM registry.fedoraproject.org/fedora:37 + +ENV HISTSIZE=10000 +ENV HISTTIMEFORMAT="%d/%m/%y %T " +ENV HISTFILESIZE=20000 + +ENV GENERAL_PKGS="\ + bash-completion \ + procps \ + iproute \ + fzf \ + wget \ + git \ + firefox \ + dbus \ + dbus-x11 \ + strace" + +# install system dependencies +RUN dnf install -y \ + ${GENERAL_PKGS} \ + && dnf clean all + +RUN echo $'[ -f /usr/share/fzf/key-bindings.bash ] && source /usr/share/fzf/key-bindings.bash \n\ +[ -f /usr/share/fzf/shell/key-bindings.bash ] && source /usr/share/fzf/shell/key-bindings.bash \n\ +[ -f /usr/share/fzf/completion.bash ] && source /usr/share/fzf/completion.bash' >> /root/.bashrc + +ENTRYPOINT [ "/bin/bash" ] diff --git a/rathole/Dockerfile b/rathole/Dockerfile new file mode 100644 index 0000000..cfbe9d9 --- /dev/null +++ b/rathole/Dockerfile @@ -0,0 +1,16 @@ +FROM registry.fedoraproject.org/fedora:37 as builder + +WORKDIR / + +RUN dnf clean all && \ + dnf install -y git cargo openssl-devel && \ + git clone https://github.com/rapiz1/rathole.git && \ + cd ./rathole && \ + cargo build --release + + +FROM registry.fedoraproject.org/fedora-minimal:37 +WORKDIR / +COPY --from=builder /rathole/target/release/rathole . +USER 1852:1852 +ENTRYPOINT ["./rathole"] diff --git a/snowflake/Dockerfile b/snowflake/Dockerfile new file mode 100644 index 0000000..da1ae83 --- /dev/null +++ b/snowflake/Dockerfile @@ -0,0 +1,22 @@ +FROM registry.fedoraproject.org/fedora:37 + +RUN useradd -u 1423 -m -s '/bin/bash' -U snowflake +ENV TZ=Europe/Warsaw + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ + dnf clean all && \ + dnf install -y git golang && \ + git clone https://git.torproject.org/pluggable-transports/snowflake.git && \ + cd snowflake/proxy && \ + go build && \ + dnf remove -y golang git && \ + dnf -y autoremove && \ + dnf -y clean all && \ + mv /snowflake/proxy/proxy /usr/bin/proxy && \ + cd / && \ + rm -rf /snowflake /root/* && \ + chown snowflake.snowflake /usr/bin/proxy + +USER snowflake + +ENTRYPOINT ["/usr/bin/proxy"]