Add containers to repo

This commit is contained in:
Kjeld Schouten
2024-10-07 14:27:10 +02:00
parent 04a1a65418
commit 0b3a98918d
136 changed files with 4164 additions and 0 deletions
View File
+42
View File
@@ -0,0 +1,42 @@
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
ARG CONTAINER_NAME
ARG CONTAINER_VER
ENV XDG_CONFIG_HOME=/config
ENV UMASK=0002
USER root
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
WORKDIR /app
# hadolint ignore=DL3018
RUN \
apk update && apk add --no-cache ca-certificates bash util-linux coreutils grep procps \
&& addgroup apps -g 568 \
&& adduser apps -u 568 -g 568 -D -S -H \
&& mkdir -p /config \
&& chown -R apps:apps /config \
&& chmod -R 775 /config \
&& chown -R apps:apps /app \
&& chmod -R 775 /app \
&& update-ca-certificates
VOLUME [ "/config" ]
USER apps
COPY ./base/ubuntu/entrypoint.sh /entrypoint.sh
COPY ./base/ubuntu/shim /etc/profile.d
ENTRYPOINT ["/bin/ash", "--"]
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
+2
View File
@@ -0,0 +1,2 @@
linux/amd64
linux/arm
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
echo "
Welcome to a TrueCharts container,
You are entering the vicinity of an area adjacent to a location.
The kind of place where there might be a monster, or some kind of weird mirror.
These are just examples; it could also be something much better.
* Repository: https://github.com/truecharts/containers
* Docs: https://truecharts.org
* Bugs or feature requests should be opened in an GH issue
* Questions should be discussed in Discord
"
+11
View File
@@ -0,0 +1,11 @@
FROM hello-world:latest@sha256:91fb4b041da273d5a3273b6d587d62d518300a6ad268b28628f74997b93171b2
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
1.0.0
+132
View File
@@ -0,0 +1,132 @@
FROM ubuntu:noble@sha256:b359f1067efa76f37863778f7b6d0e8d911e3ee8efa807ad01fbf5dc1ef9006b
ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3002
USER root
ARG CHANNEL
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
# DEBIAN_FRONTEND: https://askubuntu.com/questions/972516/debian-frontend-environment-variable
# APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE: http://stackoverflow.com/questions/48162574/ddg#49462622
ENV \
DEBCONF_NONINTERACTIVE_SEEN=true \
DEBIAN_FRONTEND="noninteractive" \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn \
UMASK="0002" \
TZ="Etc/UTC"
RUN \
adduser apps \
--uid 568 \
--group \
--system \
--disabled-password \
--no-create-home \
&& \
mkdir -p /config \
&& chown -R apps:apps /config \
&& chmod -R 775 /config
WORKDIR /app
# hadolint ignore=DL3008,DL3015
RUN \
set -eux \
&& echo 'APT::Install-Recommends "false";' >/etc/apt/apt.conf.d/00recommends \
&& echo 'APT::Install-Suggests "false";' >>/etc/apt/apt.conf.d/00recommends \
&& echo 'APT::Get::Install-Recommends "false";' >>/etc/apt/apt.conf.d/00recommends \
&& echo 'APT::Get::Install-Suggests "false";' >>/etc/apt/apt.conf.d/00recommends \
&& \
apt-get -qq update \
&& \
apt-get install -y \
bash \
ca-certificates \
curl \
dnsutils \
iputils-ping \
jo \
jq \
gnupg \
locales \
moreutils \
pv \
tini \
nano \
tzdata \
vim-tiny \
unrar \
unzip \
wget \
redis-server \
postgresql-client \
mariadb-client \
libicu70 \
pv \
git \
&& \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/vi \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/vim \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/nano \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/emacs \
&& \
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg \
&& \
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list \
&& \
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add - \
&& \
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& \
apt-get -qq update \
&& \
apt-get -qq install -y \
mongodb-mongosh \
kubectl \
&& chown -R apps:apps /app \
&& \
printf "/bin/bash /shim/greeting.sh\n" >> /etc/bash.bashrc \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& apt-get autoremove -y \
&& apt-get clean \
&& \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/cache/apt/* \
/var/tmp/* \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
ENV LANG en_US.UTF-8
VOLUME ["/config"]
COPY ./base/ubuntu/entrypoint.sh /entrypoint.sh
COPY ./base/ubuntu/shim /shim
USER apps
ENTRYPOINT [ "/usr/bin/tini", "--" ]
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+2
View File
@@ -0,0 +1,2 @@
linux/amd64
linux/arm64
+1
View File
@@ -0,0 +1 @@
jammy
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
echo "
Welcome to a TrueCharts container,
You are entering the vicinity of an area adjacent to a location.
The kind of place where there might be a monster, or some kind of weird mirror.
These are just examples; it could also be something much better.
* Repository: https://github.com/truecharts/containers
* Docs: https://truecharts.org
* This container uses the micro CLI text editor or nano respectively
* Bugs or feature requests should be opened in an GH issue
* Questions should be discussed in Discord
"
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
min_seconds="${1:-1}"
max_seconds="${2:-3600}"
seconds="$(shuf -i "${min_seconds}"-"${max_seconds}" -n 1)"
function logz {
msg="${1}"
level="${2:-info}"
printf "\e[1;32m%-6s\e[m\n" "timestamp=\"$(date +"%Y-%m-%dT%H:%M:%S%z")\" level=\"${level}\" msg=\"${msg}\""
}
function datez {
secs="${1}"
printf "%dh%dm%ds" $((secs/3600)) $((secs%3600/60)) $((secs%60))
}
printf "\e[1;32m%-6s\e[m\n" "$(logz "min seconds set to ${min_seconds}" "debug")"
printf "\e[1;32m%-6s\e[m\n" "$(logz "max seconds set to ${max_seconds}" "debug")"
printf "\e[1;32m%-6s\e[m\n" "$(logz "sleeping for $(datez "${seconds}")" "info")"
for ((i=seconds;i>0;i--)); do
printf "\e[1;32m%-6s\e[m\n" "$(logz "sleeping for $(datez "${i}")" "info")"
sleep 1
done
printf "\e[1;32m%-6s\e[m\n" "$(logz "done" "debug")"
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
echo "---Checking for optional user script---"
if [ -f /custom/user.sh ]; then
echo "---Found optional script, executing---"
chmod +x /custom/user.sh
/custom/user.sh
else
echo "---No optional user script found, continuing---"
fi
echo "---Checking for container script---"
if [ -f /custom/start.sh ]; then
echo "---Found container script, executing---"
chmod +x /custom/start.sh
/custom/start.sh
else
echo "---No container script found, continuing---"
fi
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
umask "${UMASK:-0002}"
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [[ "${WAIT_FOR_VPN:-"false"}" == "true" ]]; then
echo "Waiting for VPN to be connected..."
while ! grep -s -q "connected" /shared/vpnstatus; do
echo "VPN not connected"
sleep 2
done
echo "VPN Connected, starting application..."
fi