add gui-container, rathole, snowflake

This commit is contained in:
Maciej Lebiest 2023-03-18 19:14:16 +01:00
parent daeba22664
commit 89a002f480
4 changed files with 113 additions and 0 deletions

View file

@ -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.

28
gui-container/Dockerfile Normal file
View file

@ -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" ]

16
rathole/Dockerfile Normal file
View file

@ -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"]

22
snowflake/Dockerfile Normal file
View file

@ -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"]