From 2c88875951f77a574b7823bb9632572f294d82b2 Mon Sep 17 00:00:00 2001 From: Manuel Dielacher <31390939+Th3Dilli@users.noreply.github.com> Date: Sat, 19 Feb 2022 17:06:21 +0100 Subject: [PATCH 01/16] feat: add mohaa game image (#12) --- oses/debian/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oses/debian/Dockerfile b/oses/debian/Dockerfile index e7a48ba..d1c5293 100644 --- a/oses/debian/Dockerfile +++ b/oses/debian/Dockerfile @@ -20,7 +20,7 @@ RUN apt update \ ## Install dependencies RUN apt install -y gcc g++ libgcc1 libc++-dev gdb libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ libfontconfig libicu67 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadbclient-dev-compat libduktape205 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates \ - liblua5.3-0 libz-dev rapidjson-dev tzdata libevent-dev libzip4 + liblua5.3-0 libz-dev rapidjson-dev tzdata libevent-dev libzip4 lib32stdc++6 libstdc++5:i386 ## Configure locale RUN update-locale lang=en_US.UTF-8 \ From dd3b6473396c29a09ca6bbf6a5a1017b9064ed36 Mon Sep 17 00:00:00 2001 From: Manuel Dielacher <31390939+Th3Dilli@users.noreply.github.com> Date: Sat, 19 Feb 2022 17:06:21 +0100 Subject: [PATCH 02/16] Revert "feat: add mohaa game image (#12)" Failed Pull request with no support for multiarch. This reverts commit 2c88875951f77a574b7823bb9632572f294d82b2. --- oses/debian/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oses/debian/Dockerfile b/oses/debian/Dockerfile index d1c5293..e7a48ba 100644 --- a/oses/debian/Dockerfile +++ b/oses/debian/Dockerfile @@ -20,7 +20,7 @@ RUN apt update \ ## Install dependencies RUN apt install -y gcc g++ libgcc1 libc++-dev gdb libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ libfontconfig libicu67 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadbclient-dev-compat libduktape205 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates \ - liblua5.3-0 libz-dev rapidjson-dev tzdata libevent-dev libzip4 lib32stdc++6 libstdc++5:i386 + liblua5.3-0 libz-dev rapidjson-dev tzdata libevent-dev libzip4 ## Configure locale RUN update-locale lang=en_US.UTF-8 \ From 80bb87e8cbaf829bb2eb216b8fc4bd72b9821502 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Wed, 23 Feb 2022 16:02:00 -0500 Subject: [PATCH 03/16] make sure db images use correct entrypoint --- mariadb/10.3/Dockerfile | 2 +- mariadb/10.4/Dockerfile | 2 +- mariadb/10.5/Dockerfile | 2 +- mariadb/10.6/Dockerfile | 2 +- mariadb/10.7/Dockerfile | 2 +- postgres/10/Dockerfile | 2 +- postgres/11/Dockerfile | 2 +- postgres/12/Dockerfile | 2 +- postgres/13/Dockerfile | 2 +- postgres/14/Dockerfile | 2 +- postgres/9/Dockerfile | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mariadb/10.3/Dockerfile b/mariadb/10.3/Dockerfile index ef1ea23..17d80fe 100644 --- a/mariadb/10.3/Dockerfile +++ b/mariadb/10.3/Dockerfile @@ -15,5 +15,5 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.4/Dockerfile b/mariadb/10.4/Dockerfile index 5f0193c..83673e0 100644 --- a/mariadb/10.4/Dockerfile +++ b/mariadb/10.4/Dockerfile @@ -15,5 +15,5 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.5/Dockerfile b/mariadb/10.5/Dockerfile index f990e81..0bbf825 100644 --- a/mariadb/10.5/Dockerfile +++ b/mariadb/10.5/Dockerfile @@ -15,5 +15,5 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.6/Dockerfile b/mariadb/10.6/Dockerfile index e4adf95..ea443ca 100644 --- a/mariadb/10.6/Dockerfile +++ b/mariadb/10.6/Dockerfile @@ -15,5 +15,5 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.7/Dockerfile b/mariadb/10.7/Dockerfile index f05b006..667aa81 100644 --- a/mariadb/10.7/Dockerfile +++ b/mariadb/10.7/Dockerfile @@ -15,5 +15,5 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/postgres/10/Dockerfile b/postgres/10/Dockerfile index 44467e1..1a2c09d 100644 --- a/postgres/10/Dockerfile +++ b/postgres/10/Dockerfile @@ -12,5 +12,5 @@ USER container ENV HOME /home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/postgres/11/Dockerfile b/postgres/11/Dockerfile index 7b0b6a0..4ed6f38 100644 --- a/postgres/11/Dockerfile +++ b/postgres/11/Dockerfile @@ -12,5 +12,5 @@ USER container ENV HOME /home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/postgres/12/Dockerfile b/postgres/12/Dockerfile index ee9075e..e21d236 100644 --- a/postgres/12/Dockerfile +++ b/postgres/12/Dockerfile @@ -12,5 +12,5 @@ USER container ENV HOME /home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/postgres/13/Dockerfile b/postgres/13/Dockerfile index 9d6d418..ed1d229 100644 --- a/postgres/13/Dockerfile +++ b/postgres/13/Dockerfile @@ -12,5 +12,5 @@ USER container ENV HOME /home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/postgres/14/Dockerfile b/postgres/14/Dockerfile index 77c1fee..c41ec76 100644 --- a/postgres/14/Dockerfile +++ b/postgres/14/Dockerfile @@ -12,5 +12,5 @@ USER container ENV HOME /home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/postgres/9/Dockerfile b/postgres/9/Dockerfile index c410d10..fc94f1c 100644 --- a/postgres/9/Dockerfile +++ b/postgres/9/Dockerfile @@ -12,5 +12,5 @@ USER container ENV HOME /home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] From 1e037c37d1493b8ddb72e4bcb015b82d29dda281 Mon Sep 17 00:00:00 2001 From: Torsten Widmann Date: Sat, 12 Mar 2022 18:21:17 +0100 Subject: [PATCH 04/16] feat(wine): Mono 7.1 and HTTPS DL url (#46) --- wine/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wine/entrypoint.sh b/wine/entrypoint.sh index c98e308..3ee92c7 100644 --- a/wine/entrypoint.sh +++ b/wine/entrypoint.sh @@ -64,7 +64,7 @@ if [[ $WINETRICKS_RUN =~ mono ]]; then WINETRICKS_RUN=${WINETRICKS_RUN/mono} if [ ! -f "$WINEPREFIX/mono.msi" ]; then - wget -q -O $WINEPREFIX/mono.msi http://dl.winehq.org/wine/wine-mono/6.4.0/wine-mono-6.4.0-x86.msi + wget -q -O $WINEPREFIX/mono.msi https://dl.winehq.org/wine/wine-mono/7.1.1/wine-mono-7.1.1-x86.msi fi wine msiexec /i $WINEPREFIX/mono.msi /qn /quiet /norestart /log $WINEPREFIX/mono_install.log From 5fd5db9c81f3b3058f50afac5ecbd65cfb209bb9 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 13 Mar 2022 11:46:58 +0100 Subject: [PATCH 05/16] Update ALTV The image was broken , It spit out a error: `[09:00:13][Error] Error loading "libcsharp-module.so", Unix error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: Version `GLIBCXX_3.4.26' not found (required by /home/container/modules/libcsharp-module.so)` --- games/altv/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/altv/Dockerfile b/games/altv/Dockerfile index 0063e6f..a71b4ca 100644 --- a/games/altv/Dockerfile +++ b/games/altv/Dockerfile @@ -11,7 +11,7 @@ RUN useradd -m -d /home/container -s /bin/bash container RUN apt update -y \ && apt upgrade -y \ - && apt install -y gcc g++ libgcc-s1 lib32gcc-s1 gdb libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ + && apt install -y g++ gcc libgcc-s1 lib32gcc-s1 gdb libstdc++6 libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ libfontconfig1 libicu67 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadb-dev libduktape205 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates tzdata \ python3 dnsutils build-essential coreutils jq pcregrep From 1769dffa3182cce467de8494ab8853fb0a44b17b Mon Sep 17 00:00:00 2001 From: IAmSilK Date: Wed, 23 Mar 2022 17:57:29 -0300 Subject: [PATCH 06/16] Add optional mods environment variable which allows for downloading mods without requiring them from clients --- games/arma3/entrypoint.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/games/arma3/entrypoint.sh b/games/arma3/entrypoint.sh index ecfb182..9414605 100644 --- a/games/arma3/entrypoint.sh +++ b/games/arma3/entrypoint.sh @@ -20,7 +20,7 @@ RED='\033[0;31m' NC='\033[0m' # No Color ## === ENVIRONMENT VARS === -# STARTUP, STARTUP_PARAMS, STEAM_USER, STEAM_PASS, SERVER_BINARY, MOD_FILE, MODIFICATIONS, SERVERMODS, UPDATE_SERVER, CLEAR_CACHE, VALIDATE_SERVER, MODS_LOWERCASE, STEAMCMD_EXTRA_FLAGS, CDLC, STEAMCMD_APPID, HC_NUM, SERVER_PASSWORD, HC_HIDE, STEAMCMD_ATTEMPTS, BASIC_URL, DISABLE_MOD_UPDATES +# STARTUP, STARTUP_PARAMS, STEAM_USER, STEAM_PASS, SERVER_BINARY, MOD_FILE, MODIFICATIONS, SERVERMODS, OPTIONALMODS, UPDATE_SERVER, CLEAR_CACHE, VALIDATE_SERVER, MODS_LOWERCASE, STEAMCMD_EXTRA_FLAGS, CDLC, STEAMCMD_APPID, HC_NUM, SERVER_PASSWORD, HC_HIDE, STEAMCMD_ATTEMPTS, BASIC_URL, DISABLE_MOD_UPDATES ## === GLOBAL VARS === # validateServer, extraFlags, updateAttempt, modifiedStartup, allMods, CLIENT_MODS @@ -183,6 +183,11 @@ if [[ -n ${SERVERMODS} ]] && [[ ${SERVERMODS} != *\; ]]; then # Add server mods else allMods=${SERVERMODS} fi +if [[ -n ${OPTIONALMODS} ]] && [[ ${OPTIONALMODS} != *\; ]]; then # Add manually specified mods to the client-side mods list, while checking for trailing semicolon + allMods+="${OPTIONALMODS};" +else + allMods+=${OPTIONALMODS} +fi allMods+=$CLIENT_MODS # Add all client-side mods to the master mod list CLIENT_MODS=$(RemoveDuplicates ${CLIENT_MODS}) # Remove duplicate mods from CLIENT_MODS, if present allMods=$(RemoveDuplicates ${allMods}) # Remove duplicate mods from allMods, if present From e79e8cdd4d764a045e0481f84c6ba273d448ab2d Mon Sep 17 00:00:00 2001 From: IAmSilK Date: Fri, 25 Mar 2022 01:50:24 -0300 Subject: [PATCH 07/16] Ensure optional mods files are deleted after downloading and keys are removed if an optional mod is unconfigured --- games/arma3/entrypoint.sh | 68 +++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/games/arma3/entrypoint.sh b/games/arma3/entrypoint.sh index 9414605..31b19fd 100644 --- a/games/arma3/entrypoint.sh +++ b/games/arma3/entrypoint.sh @@ -28,7 +28,7 @@ NC='\033[0m' # No Color ## === DEFINE FUNCTIONS === # # Runs SteamCMD with specified variables and performs error handling. -function RunSteamCMD { #[Input: int server=0 mod=1; int id] +function RunSteamCMD { #[Input: int server=0 mod=1 optional_mod=2; int id] # Clear previous SteamCMD log if [[ -f "${STEAMCMD_LOG}" ]]; then rm -f "${STEAMCMD_LOG:?}" @@ -110,7 +110,23 @@ function RunSteamCMD { #[Input: int server=0 mod=1; int id] ModsLowercase @$2 # Move any .bikey's to the keys directory echo -e "\tMoving any mod ${CYAN}.bikey${NC} files to the ${CYAN}~/keys/${NC} folder..." - find ./@$2 -name "*.bikey" -type f -exec cp {} ./keys \; + if [[ $1 == 1 ]]; then + find ./@$2 -name "*.bikey" -type f -exec cp {} ./keys \; + else + # Give optional mod keys a custom name which can be checked later for deleting unconfigured mods + for file in $(find ./@$2 -name "*.bikey" -type f); do + filename=$(basename ${file}) + + cp $file ./keys/optional_$2_${filename} + + done; + + echo -e "\tMod with ID $2 is an optional mod. Deleting original mod download folder..." + rm -r ./@$2 + + # Recreate a directory so time-based detection of auto updates works correctly + mkdir ./@$2_optional + fi echo -e "${GREEN}[UPDATE]: Mod download/update successful!${NC}" fi break @@ -183,7 +199,7 @@ if [[ -n ${SERVERMODS} ]] && [[ ${SERVERMODS} != *\; ]]; then # Add server mods else allMods=${SERVERMODS} fi -if [[ -n ${OPTIONALMODS} ]] && [[ ${OPTIONALMODS} != *\; ]]; then # Add manually specified mods to the client-side mods list, while checking for trailing semicolon +if [[ -n ${OPTIONALMODS} ]] && [[ ${OPTIONALMODS} != *\; ]]; then # Add specified optional mods to the mods list, while checking for trailing semicolon allMods+="${OPTIONALMODS};" else allMods+=${OPTIONALMODS} @@ -228,16 +244,28 @@ if [[ ${UPDATE_SERVER} == 1 ]]; then for modID in $(echo $allMods | sed -e 's/@//g') do if [[ $modID =~ ^[0-9]+$ ]]; then # Only check mods that are in ID-form + # If a mod is defined in OPTIONALMODS, and is not defined in CLIENT_MODS or SERVERMODS, then treat as an optional mod + # Optional mods are given a different directory which is checked to see if a new update is available. This is to ensure + # if an optional mod is switched to be a standard client-side mod, this script will redownload the mod + if [[ "${OPTIONALMODS}" == *"@${modID};"* ]] && [[ "${CLIENT_MODS}" != *"@${modID};"* ]] && [[ "${SERVERMODS}" != *"@${modID};"* ]]; then + modType=2 + modDir=@${modID}_optional + else + modType=1 + modDir=@${modID} + fi + # Get mod's latest update in epoch time from its Steam Workshop changelog page latestUpdate=$(curl -sL https://steamcommunity.com/sharedfiles/filedetails/changelog/$modID | grep '

$(find @$modID | head -1 | xargs stat -c%Y) ) ]]; then + if [[ ! -d $modDir ]] || [[ ( -n $latestUpdate ) && ( $latestUpdate =~ ^[0-9]+$ ) && ( $latestUpdate > $(find $modDir | head -1 | xargs stat -c%Y) ) ]]; then # Get the mod's name from the Workshop page as well modName=$(curl -sL https://steamcommunity.com/sharedfiles/filedetails/changelog/$modID | grep 'workshopItemTitle' | cut -d'>' -f2 | cut -d'<' -f1) if [[ -z $modName ]]; then # Set default name if unavailable modName="[NAME UNAVAILABLE]" fi - if [[ ! -d @$modID ]]; then + if [[ ! -d $modDir ]]; then echo -e "\n${GREEN}[UPDATE]:${NC} Downloading new Mod: \"${CYAN}${modName}${NC}\" (${CYAN}${modID}${NC})" else echo -e "\n${GREEN}[UPDATE]:${NC} Mod update found for: \"${CYAN}${modName}${NC}\" (${CYAN}${modID}${NC})" @@ -246,10 +274,38 @@ if [[ ${UPDATE_SERVER} == 1 ]]; then echo -e "\tMod was last updated: ${CYAN}$(date -d @${latestUpdate})${NC}" fi echo -e "\tAttempting mod update/download via SteamCMD...\n" - RunSteamCMD 1 $modID + + RunSteamCMD $modType $modID fi fi done + + # Check over key files for unconfigured optional mods' .bikey files + for keyFile in $(find ./keys -name "*.bikey" -type f); do + keyFileName=$(basename ${keyFile}) + + # If the key file is using the optional mod file name + if [[ "${keyFileName}" == "optional_"* ]]; then + modID=$(echo "${keyFileName}" | cut -d _ -f 2) + + # If mod is not in optional mods, delete it + # If a mod is configured in CLIENT_MODS or SERVERMODS, we should still delete this file + # as a new file will have been copied that does not follow the naming scheme + if [[ "${OPTIONALMODS}" != *"@${modID};"* ]]; then + + # We only need to let the user know the key file is being deleted if this mod is no longer configured at all. + # If CLIENT_MODS contains the mod ID, we'd just confuse the user by telling them we are deleting the optional .bikey file + if [[ "${CLIENT_MODS}" != *"@${modID};"* ]]; then + echo -e "\tKey file and directory for unconfigured optional mod ${CYAN}${modID}${NC} is being deleted..." + fi + + # Delete the optional mod .bikey file and directory + rm ${keyFile} + rmdir ./@${modID}_optional 2> /dev/null + fi + fi + done; + echo -e "${GREEN}[UPDATE]:${NC} Steam Workshop mod update check ${GREEN}complete${NC}!" fi fi From b99d99e233855e44e4dc22f01f7c9ed78ededa33 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 26 Mar 2022 17:41:49 +0200 Subject: [PATCH 08/16] feat(arma): install tzdata resolves #50 --- games/arma3/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/arma3/Dockerfile b/games/arma3/Dockerfile index 922cdb6..49ec2a8 100644 --- a/games/arma3/Dockerfile +++ b/games/arma3/Dockerfile @@ -11,7 +11,7 @@ RUN dpkg --add-architecture i386 \ && apt-get update \ && apt-get upgrade -y \ && apt-get install -y libgcc-10-dev libstdc++-10-dev libtinfo5 lib64z1 libcurl3-gnutls \ - && apt-get install -y libnss-wrapper gettext-base tar curl gcc g++ libc6 libtbb2 lib32z1 lib32gcc1 lib32stdc++6 libsdl2-2.0-0 libsdl2-2.0-0:i386 libtbb2:i386 lib32stdc++6 libtinfo5:i386 libncurses5:i386 libcurl3-gnutls:i386 \ + && apt-get install -y libnss-wrapper gettext-base tar curl gcc g++ libc6 libtbb2 lib32z1 lib32gcc1 lib32stdc++6 libsdl2-2.0-0 libsdl2-2.0-0:i386 libtbb2:i386 lib32stdc++6 libtinfo5:i386 libncurses5:i386 libcurl3-gnutls:i386 tzdata \ && useradd -m -d /home/container -s /bin/bash container \ && touch ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} \ && chgrp 0 ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} \ From fb6c0dcf56d215337ab797d48bd6ffd2dbc5327f Mon Sep 17 00:00:00 2001 From: CDE90 Date: Sun, 17 Apr 2022 16:16:14 +0100 Subject: [PATCH 09/16] Add rust language --- .github/workflows/rust.yml | 43 ++++++++++++++++++++++++++++++++++++++ rust/1.31/Dockerfile | 14 +++++++++++++ rust/1.56/Dockerfile | 14 +++++++++++++ rust/1.60/Dockerfile | 14 +++++++++++++ rust/entrypoint.sh | 15 +++++++++++++ rust/latest/Dockerfile | 14 +++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 .github/workflows/rust.yml create mode 100644 rust/1.31/Dockerfile create mode 100644 rust/1.56/Dockerfile create mode 100644 rust/1.60/Dockerfile create mode 100644 rust/entrypoint.sh create mode 100644 rust/latest/Dockerfile diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..99d04f3 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,43 @@ +name: build rust +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - rust/** +jobs: + push: + name: "yolks:rust_${{ matrix.tag }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tag: + - '1.31' + - '1.56' + - '1.60' + - 'latest' + steps: + - uses: actions/checkout@v2 + # Setup QEMU for ARM64 Build + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + with: + version: "v0.5.1" + buildkitd-flags: --debug + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + - uses: docker/build-push-action@v2 + with: + context: ./rust + file: ./rust/${{ matrix.tag }}/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/parkervcp/yolks:rust_${{ matrix.tag }} diff --git a/rust/1.31/Dockerfile b/rust/1.31/Dockerfile new file mode 100644 index 0000000..840bc9f --- /dev/null +++ b/rust/1.31/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.31-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/rust/1.56/Dockerfile b/rust/1.56/Dockerfile new file mode 100644 index 0000000..9d3bed6 --- /dev/null +++ b/rust/1.56/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.56-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/rust/1.60/Dockerfile b/rust/1.60/Dockerfile new file mode 100644 index 0000000..5624cc2 --- /dev/null +++ b/rust/1.60/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.60-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/rust/entrypoint.sh b/rust/entrypoint.sh new file mode 100644 index 0000000..ed8bce1 --- /dev/null +++ b/rust/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` + +# Print current Rust version +cargo --version + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/rust/latest/Dockerfile b/rust/latest/Dockerfile new file mode 100644 index 0000000..3d94aeb --- /dev/null +++ b/rust/latest/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file From e889a1e143ea512a90da7c0e5f4eee86b8f6a565 Mon Sep 17 00:00:00 2001 From: CDE90 Date: Sun, 17 Apr 2022 16:19:55 +0100 Subject: [PATCH 10/16] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 9d54cf5..59361ca 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,17 @@ is tagged correctly. * [`Redis 6`](/redis/6) * `ghcr.io/parkervcp/yolks:redis_6` +### [Rust](/rust) + +* ['rust1.31'](/rust/1.31) + * `ghcr.io/parkervcp/yolks:rust_1.31` +* ['rust1.56'](/rust/1.56) + * `ghcr.io/parkervcp/yolks:rust_1.56` +* ['rust1.60'](/rust/1.60) + * `ghcr.io/parkervcp/yolks:rust_1.60` +* ['rust latest'](/rust/latest) + * `ghcr.io/parkervcp/yolks:rust_latest` + ### [Voice](/voice) * [`TeaSpeak`](/teaspeak) From bc57e78b0c369b406eff36839f7dfd095ca7ee01 Mon Sep 17 00:00:00 2001 From: gOOvER Date: Fri, 22 Apr 2022 07:36:18 +0200 Subject: [PATCH 11/16] add nodejs18 --- .github/workflows/nodejs.yml | 1 + nodejs/18/Dockerfile | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 nodejs/18/Dockerfile diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 179c8b5..8bf5235 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -20,6 +20,7 @@ jobs: - 14 - 16 - 17 + - 18 steps: - uses: actions/checkout@v2 # Setup QEMU for ARM64 Build diff --git a/nodejs/18/Dockerfile b/nodejs/18/Dockerfile new file mode 100644 index 0000000..8ce29ce --- /dev/null +++ b/nodejs/18/Dockerfile @@ -0,0 +1,15 @@ +FROM --platform=$TARGETOS/$TARGETARCH node:18-bullseye-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool \ + && npm -g install npm@latest \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] From 91cba2e3e52b5947e1777999e338a93857b7bfb8 Mon Sep 17 00:00:00 2001 From: gOOvER Date: Fri, 22 Apr 2022 07:38:43 +0200 Subject: [PATCH 12/16] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9d54cf5..8726abc 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,8 @@ is tagged correctly. * `ghcr.io/parkervcp/yolks:nodejs_16` * [`node17`](/nodejs/17) * `ghcr.io/parkervcp/yolks:nodejs_17` +* [`node18`](/nodejs/18) + * `ghcr.io/parkervcp/yolks:nodejs_18` ### [PostgreSQL](/postgres) * [`Postgres 9`](/postgres/9) From cd6b94986888030898f126fc1ce1ff977c80a82b Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 24 Apr 2022 18:10:20 +0300 Subject: [PATCH 13/16] fix: invalid INTERNAL_IP environment value New IP route output appends UID to the result, causing the value to be set to that instead of the IP. Fix it by ignoring the last two appended UID results --- bot/bastion/entrypoint.sh | 5 +++-- bot/parkertron/entrypoint.sh | 5 +++-- bot/red/entrypoint.sh | 7 ++++--- bot/sinusbot/entrypoint.sh | 5 +++-- cassandra/entrypoint.sh | 2 +- dotnet/entrypoint.sh | 5 +++-- erlang/entrypoint.sh | 2 +- games/altv/entrypoint.sh | 7 ++++--- games/arma3/entrypoint.sh | 27 ++++++++++++++++----------- games/source/entrypoint.sh | 2 +- go/entrypoint.sh | 4 ++-- java/entrypoint.sh | 2 +- mariadb/entrypoint.sh | 3 ++- mongodb/entrypoint.sh | 3 ++- mono/entrypoint.sh | 3 ++- nodejs/entrypoint.sh | 3 ++- oses/alpine/entrypoint.sh | 4 ++-- oses/debian/entrypoint.sh | 7 ++++--- oses/ubuntu/entrypoint.sh | 5 +++-- postgres/entrypoint.sh | 3 ++- python/entrypoint.sh | 3 ++- redis/entrypoint.sh | 3 ++- rust/entrypoint.sh | 3 ++- voice/teaspeak/entrypoint.sh | 2 +- wine/entrypoint.sh | 3 ++- 25 files changed, 70 insertions(+), 48 deletions(-) diff --git a/bot/bastion/entrypoint.sh b/bot/bastion/entrypoint.sh index 06c0ce9..d5bdcc7 100644 --- a/bot/bastion/entrypoint.sh +++ b/bot/bastion/entrypoint.sh @@ -1,8 +1,9 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) diff --git a/bot/parkertron/entrypoint.sh b/bot/parkertron/entrypoint.sh index c39e96c..1971986 100644 --- a/bot/parkertron/entrypoint.sh +++ b/bot/parkertron/entrypoint.sh @@ -1,8 +1,9 @@ #!/bin/ash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` diff --git a/bot/red/entrypoint.sh b/bot/red/entrypoint.sh index cdb1fd1..d5bdcc7 100644 --- a/bot/red/entrypoint.sh +++ b/bot/red/entrypoint.sh @@ -1,12 +1,13 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) echo -e ":/home/container$ ${MODIFIED_STARTUP}" # Run the Server -eval ${MODIFIED_STARTUP} \ No newline at end of file +eval ${MODIFIED_STARTUP} diff --git a/bot/sinusbot/entrypoint.sh b/bot/sinusbot/entrypoint.sh index 33e5ddc..d0aea75 100644 --- a/bot/sinusbot/entrypoint.sh +++ b/bot/sinusbot/entrypoint.sh @@ -1,8 +1,9 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` diff --git a/cassandra/entrypoint.sh b/cassandra/entrypoint.sh index 3df1092..2541719 100644 --- a/cassandra/entrypoint.sh +++ b/cassandra/entrypoint.sh @@ -5,7 +5,7 @@ TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/dotnet/entrypoint.sh b/dotnet/entrypoint.sh index 13d9e20..11acd70 100644 --- a/dotnet/entrypoint.sh +++ b/dotnet/entrypoint.sh @@ -1,8 +1,9 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') diff --git a/erlang/entrypoint.sh b/erlang/entrypoint.sh index 6875d24..7511c57 100644 --- a/erlang/entrypoint.sh +++ b/erlang/entrypoint.sh @@ -3,7 +3,7 @@ TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/games/altv/entrypoint.sh b/games/altv/entrypoint.sh index d9f5b44..11acd70 100644 --- a/games/altv/entrypoint.sh +++ b/games/altv/entrypoint.sh @@ -1,12 +1,13 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') echo -e ":/home/container$ ${MODIFIED_STARTUP}" # Run the Server -eval ${MODIFIED_STARTUP} \ No newline at end of file +eval ${MODIFIED_STARTUP} diff --git a/games/arma3/entrypoint.sh b/games/arma3/entrypoint.sh index 31b19fd..d01b9a4 100644 --- a/games/arma3/entrypoint.sh +++ b/games/arma3/entrypoint.sh @@ -33,24 +33,24 @@ function RunSteamCMD { #[Input: int server=0 mod=1 optional_mod=2; int id] if [[ -f "${STEAMCMD_LOG}" ]]; then rm -f "${STEAMCMD_LOG:?}" fi - + updateAttempt=0 while (( $updateAttempt < $STEAMCMD_ATTEMPTS )); do # Loop for specified number of attempts # Increment attempt counter updateAttempt=$((updateAttempt+1)) - + if (( $updateAttempt > 1 )); then # Notify if not first attempt echo -e "\t${YELLOW}Re-Attempting download/update in 3 seconds...${NC} (Attempt ${CYAN}${updateAttempt}${NC} of ${CYAN}${STEAMCMD_ATTEMPTS}${NC})\n" sleep 3 fi - + # Check if updating server or mod if [[ $1 == 0 ]]; then # Server ${STEAMCMD_DIR}/steamcmd.sh +force_install_dir /home/container "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +app_update $2 $extraFlags $validateServer +quit | tee -a "${STEAMCMD_LOG}" else # Mod ${STEAMCMD_DIR}/steamcmd.sh "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +workshop_download_item $GAME_ID $2 +quit | tee -a "${STEAMCMD_LOG}" fi - + # Error checking for SteamCMD steamcmdExitCode=${PIPESTATUS[0]} if [[ -n $(grep -i "error\|failed" "${STEAMCMD_LOG}" | grep -iv "setlocal\|SDL") ]]; then # Catch errors (ignore setlocale and SDL warnings) @@ -166,6 +166,11 @@ function RemoveDuplicates { #[Input: str - Output: printf of new str] } # === ENTRYPOINT START === + +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + cd /home/container sleep 1 @@ -213,17 +218,17 @@ allMods=$(echo $allMods | sed -e 's/;/ /g') # Convert from string to array if [[ ${UPDATE_SERVER} == 1 ]]; then echo -e "\n${GREEN}[STARTUP]: ${CYAN}Starting checks for all updates...${NC}" echo -e "(It is okay to ignore any \"SDL\" errors during this process)\n" - + ## Update game server echo -e "${GREEN}[UPDATE]:${NC} Checking for game server updates with App ID: ${CYAN}${STEAMCMD_APPID}${NC}..." - + if [[ ${VALIDATE_SERVER} == 1 ]]; then # Validate will be added as a parameter if specified echo -e "\t${CYAN}File validation enabled.${NC} (This may take extra time to complete)" validateServer="validate" else validateServer="" fi - + # Determine what extra flags should be set if [[ -n ${STEAMCMD_EXTRA_FLAGS} ]]; then echo -e "\t(${YELLOW}Advanced${NC}) Extra SteamCMD flags specified: ${CYAN}${STEAMCMD_EXTRA_FLAGS}${NC}\n" @@ -235,9 +240,9 @@ if [[ ${UPDATE_SERVER} == 1 ]]; then echo -e "" extraFlags="" fi - + RunSteamCMD 0 ${STEAMCMD_APPID} - + ## Update mods if [[ -n $allMods ]] && [[ ${DISABLE_MOD_UPDATES} != 1 ]]; then echo -e "\n${GREEN}[UPDATE]:${NC} Checking all ${CYAN}Steam Workshop mods${NC} for updates..." @@ -274,7 +279,7 @@ if [[ ${UPDATE_SERVER} == 1 ]]; then echo -e "\tMod was last updated: ${CYAN}$(date -d @${latestUpdate})${NC}" fi echo -e "\tAttempting mod update/download via SteamCMD...\n" - + RunSteamCMD $modType $modID fi fi @@ -298,7 +303,7 @@ if [[ ${UPDATE_SERVER} == 1 ]]; then if [[ "${CLIENT_MODS}" != *"@${modID};"* ]]; then echo -e "\tKey file and directory for unconfigured optional mod ${CYAN}${modID}${NC} is being deleted..." fi - + # Delete the optional mod .bikey file and directory rm ${keyFile} rmdir ./@${modID}_optional 2> /dev/null diff --git a/games/source/entrypoint.sh b/games/source/entrypoint.sh index f2f2744..8f43bc9 100644 --- a/games/source/entrypoint.sh +++ b/games/source/entrypoint.sh @@ -30,7 +30,7 @@ TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/go/entrypoint.sh b/go/entrypoint.sh index ab6fbe7..7adafec 100644 --- a/go/entrypoint.sh +++ b/go/entrypoint.sh @@ -20,14 +20,14 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# +# # Default the TZ environment variable to UTC. TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/java/entrypoint.sh b/java/entrypoint.sh index b6d29da..e92f3d3 100644 --- a/java/entrypoint.sh +++ b/java/entrypoint.sh @@ -27,7 +27,7 @@ TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/mariadb/entrypoint.sh b/mariadb/entrypoint.sh index cd80a9a..d3884d4 100644 --- a/mariadb/entrypoint.sh +++ b/mariadb/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') diff --git a/mongodb/entrypoint.sh b/mongodb/entrypoint.sh index cd80a9a..d3884d4 100644 --- a/mongodb/entrypoint.sh +++ b/mongodb/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') diff --git a/mono/entrypoint.sh b/mono/entrypoint.sh index ef6ae2e..fe2d5f6 100644 --- a/mono/entrypoint.sh +++ b/mono/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP="eval $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')" diff --git a/nodejs/entrypoint.sh b/nodejs/entrypoint.sh index 440c2bf..60c2279 100644 --- a/nodejs/entrypoint.sh +++ b/nodejs/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Print Node.js Version node -v diff --git a/oses/alpine/entrypoint.sh b/oses/alpine/entrypoint.sh index 5b4ce5f..e156de6 100644 --- a/oses/alpine/entrypoint.sh +++ b/oses/alpine/entrypoint.sh @@ -18,14 +18,14 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# +# # Default the TZ environment variable to UTC. TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/oses/debian/entrypoint.sh b/oses/debian/entrypoint.sh index 9a5cab5..461e6b9 100644 --- a/oses/debian/entrypoint.sh +++ b/oses/debian/entrypoint.sh @@ -1,12 +1,13 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') echo -e ":/home/container$ ${MODIFIED_STARTUP}" # Run the Server -eval ${MODIFIED_STARTUP} \ No newline at end of file +eval ${MODIFIED_STARTUP} diff --git a/oses/ubuntu/entrypoint.sh b/oses/ubuntu/entrypoint.sh index d9f5b44..461e6b9 100644 --- a/oses/ubuntu/entrypoint.sh +++ b/oses/ubuntu/entrypoint.sh @@ -2,11 +2,12 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') echo -e ":/home/container$ ${MODIFIED_STARTUP}" # Run the Server -eval ${MODIFIED_STARTUP} \ No newline at end of file +eval ${MODIFIED_STARTUP} diff --git a/postgres/entrypoint.sh b/postgres/entrypoint.sh index 0a72c42..53b47f4 100644 --- a/postgres/entrypoint.sh +++ b/postgres/entrypoint.sh @@ -5,7 +5,8 @@ cd /home/container postgres --version # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` diff --git a/python/entrypoint.sh b/python/entrypoint.sh index 0a7b93d..aab4aea 100644 --- a/python/entrypoint.sh +++ b/python/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Print current Python version python --version diff --git a/redis/entrypoint.sh b/redis/entrypoint.sh index e0ae99e..6e19f17 100644 --- a/redis/entrypoint.sh +++ b/redis/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') diff --git a/rust/entrypoint.sh b/rust/entrypoint.sh index ed8bce1..c865f6c 100644 --- a/rust/entrypoint.sh +++ b/rust/entrypoint.sh @@ -2,7 +2,8 @@ cd /home/container # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP # Print current Rust version cargo --version diff --git a/voice/teaspeak/entrypoint.sh b/voice/teaspeak/entrypoint.sh index 49123df..9b0d21f 100644 --- a/voice/teaspeak/entrypoint.sh +++ b/voice/teaspeak/entrypoint.sh @@ -3,7 +3,7 @@ TZ=${TZ:-UTC} export TZ # Set environment variable that holds the Internal Docker IP -INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Switch to the container's working directory diff --git a/wine/entrypoint.sh b/wine/entrypoint.sh index 3ee92c7..be33420 100644 --- a/wine/entrypoint.sh +++ b/wine/entrypoint.sh @@ -7,7 +7,8 @@ echo "Current timezone: $(cat /etc/timezone)" wine --version # Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP ## just in case someone removed the defaults. if [ "${STEAM_USER}" == "" ]; then From 70e5a4321ac4db5f541f0c254a9fc6434fbe866e Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Mon, 2 May 2022 17:30:09 +0200 Subject: [PATCH 14/16] add samp image --- .github/workflows/games.yml | 1 + README.md | 2 ++ games/samp/Dockerfile | 23 +++++++++++++++++++++++ games/samp/entrypoint.sh | 12 ++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 games/samp/Dockerfile create mode 100644 games/samp/entrypoint.sh diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index 2a84791..53e7d85 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -19,6 +19,7 @@ jobs: - altv - arma3 - source + - samp steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 diff --git a/README.md b/README.md index fa04efe..b6aef34 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,8 @@ is tagged correctly. * `ghcr.io/parkervcp/games:arma3` * [`source`](/games/source) * `ghcr.io/parkervcp/games:source` +* [`samp`](/games/samp) + * `ghcr.io/parkervcp/games:samp` ### [Golang](/go) diff --git a/games/samp/Dockerfile b/games/samp/Dockerfile new file mode 100644 index 0000000..3e05c2f --- /dev/null +++ b/games/samp/Dockerfile @@ -0,0 +1,23 @@ +FROM --platform=$BUILDPLATFORM debian:bullseye-slim + +LABEL author="QuintenQVD" maintainer="josdekurk@gmail.com" + +RUN apt update \ + && apt -y upgrade +RUN dpkg --add-architecture i386 \ + && apt update \ + && apt upgrade -y \ + && apt install -y libstdc++6 lib32stdc++6 tar curl iproute2 openssl fontconfig dirmngr ca-certificates dnsutils tzdata zip \ + && apt install -y libtbb2:i386 libtbb-dev:i386 libicu-dev:i386 tzdata \ + && useradd -d /home/container -m container + +RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container +RUN rm -rf /var/lib/apt/lists/* + + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/games/samp/entrypoint.sh b/games/samp/entrypoint.sh new file mode 100644 index 0000000..6dda5e5 --- /dev/null +++ b/games/samp/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'` + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} From 73a2340b3be9ffc1b540eb1d1a90eada3cca8a28 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Mon, 2 May 2022 17:54:08 +0200 Subject: [PATCH 15/16] fix alphabetical orde --- .github/workflows/games.yml | 3 ++- README.md | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index 53e7d85..d4ec133 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -18,8 +18,9 @@ jobs: game: - altv - arma3 - - source - samp + - source + steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 diff --git a/README.md b/README.md index b6aef34..e0ddbbe 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,11 @@ is tagged correctly. * `ghcr.io/parkervcp/games:altv` * [`arma3`](/games/arma3) * `ghcr.io/parkervcp/games:arma3` +* [`samp`](/games/samp) + * `ghcr.io/parkervcp/games:samp` * [`source`](/games/source) * `ghcr.io/parkervcp/games:source` -* [`samp`](/games/samp) - * `ghcr.io/parkervcp/games:samp` + ### [Golang](/go) From bb84c74981cf488bd03b88c5d1234b86e5b55a11 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Tue, 3 May 2022 07:06:37 +0200 Subject: [PATCH 16/16] Fix double tzdata install --- games/samp/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/games/samp/Dockerfile b/games/samp/Dockerfile index 3e05c2f..e1b5ff4 100644 --- a/games/samp/Dockerfile +++ b/games/samp/Dockerfile @@ -8,7 +8,7 @@ RUN dpkg --add-architecture i386 \ && apt update \ && apt upgrade -y \ && apt install -y libstdc++6 lib32stdc++6 tar curl iproute2 openssl fontconfig dirmngr ca-certificates dnsutils tzdata zip \ - && apt install -y libtbb2:i386 libtbb-dev:i386 libicu-dev:i386 tzdata \ + && apt install -y libtbb2:i386 libtbb-dev:i386 libicu-dev:i386 \ && useradd -d /home/container -m container RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container @@ -20,4 +20,4 @@ ENV USER=container HOME=/home/container WORKDIR /home/container COPY ./entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file +CMD [ "/bin/bash", "/entrypoint.sh" ]