diff --git a/README.md b/README.md index 06a0fd8..3e3d8b7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,20 @@ # Containers-Workspace Various useful and useless Dockerfiles, often experimental and work in progress +## toolbox + +Fedora based container wih preinstalled many usefull tools for various debug and problem searching purposes +run help-toolbox to show what can you do in there + +Typical container run options that allows for host data access: +```bash +podman run --rm -it --privileged \ + --network host --pid host --ipc host --no-hosts --ulimit host \ + --userns host \ + --name toolbox toolbox +``` + + ## gui-container gui-container is an experiment for apps with GUI diff --git a/gui-container/Dockerfile b/gui-container/Dockerfile index 729c6da..0b27e48 100644 --- a/gui-container/Dockerfile +++ b/gui-container/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 ENV HISTSIZE=10000 ENV HISTTIMEFORMAT="%d/%m/%y %T " diff --git a/rathole/Dockerfile b/rathole/Dockerfile index cfbe9d9..f7d1851 100644 --- a/rathole/Dockerfile +++ b/rathole/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/fedora:37 as builder +FROM registry.fedoraproject.org/fedora:38 as builder WORKDIR / @@ -9,7 +9,7 @@ RUN dnf clean all && \ cargo build --release -FROM registry.fedoraproject.org/fedora-minimal:37 +FROM registry.fedoraproject.org/fedora-minimal:38 WORKDIR / COPY --from=builder /rathole/target/release/rathole . USER 1852:1852 diff --git a/snowflake/Dockerfile b/snowflake/Dockerfile index da1ae83..47ebf22 100644 --- a/snowflake/Dockerfile +++ b/snowflake/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 RUN useradd -u 1423 -m -s '/bin/bash' -U snowflake ENV TZ=Europe/Warsaw diff --git a/toolbox/Dockerfile b/toolbox/Dockerfile new file mode 100644 index 0000000..a8e5547 --- /dev/null +++ b/toolbox/Dockerfile @@ -0,0 +1,15 @@ +FROM registry.fedoraproject.org/fedora:38 + +ENV PKGS_GENERAL="htop \ + btop" + +RUN dnf clean all && \ + dnf install -y ${PKGS_GENERAL} && \ + dnf -y autoremove && \ + dnf -y clean all + +COPY help-toolbox.sh /usr/bin/help-toolbox + +RUN chmod 555 /usr/bin/help-toolbox + +USER root diff --git a/toolbox/help-toolbox.sh b/toolbox/help-toolbox.sh new file mode 100644 index 0000000..d0882be --- /dev/null +++ b/toolbox/help-toolbox.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# print $1 element $2 times, or if only one argument +# supplied then print space $1 times +function repeat() { + x=0 + + if [ $# -eq 2 ]; then + char="$1" + count="$2" + else + char=" " + count="$1" + fi + while [ $x -lt "$count" ]; + do + echo -n "$char" + x=$((x+1)) + done +} +# print "fancy title" +function printTitle() { + termWidth=$(tput cols) + textWidth=$(echo -n "$1" | wc -c) + spaces1=$(((termWidth-textWidth-2) / 2)) + spaces2=$((termWidth-spaces1-textWidth-2)) + + repeat "#" "$termWidth" + echo "" + echo -n "#" + repeat $spaces1 + echo -n "$1" + repeat $spaces2 + echo "#" + repeat "#" "$termWidth" +} + +# print tools sorted by category + +printTitle "Toolbox pkgs" + +printTitle "General" +printTitle "Processes" +printTitle "Network" +printTitle "Memory" +printTitle "Storage" diff --git a/tor/Dockerfile b/tor/Dockerfile index b74df69..996fb46 100644 --- a/tor/Dockerfile +++ b/tor/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 RUN dnf clean all && \ dnf install -y tor nyx util-linux && \