From 36f90183e2e09505585916ca96b855e6861892f4 Mon Sep 17 00:00:00 2001 From: Softwarenoob Date: Fri, 6 Aug 2021 23:20:24 +0300 Subject: [PATCH] fix: build workflows and migrate base to oses Fix bot image workflow build and migrate base images to oses since it appears we already have such folder - although badly named (why not base?). --- .github/workflows/base.yml | 15 +++++----- .github/workflows/bot.yml | 2 +- README.md | 2 ++ base/debian/Dockerfile | 30 -------------------- bot/red/Dockerfile | 2 +- oses/debian/Dockerfile | 41 ++++++++++++++++----------- oses/debian/entrypoint.sh | 44 ----------------------------- {base => oses}/ubuntu/Dockerfile | 4 +-- {base => oses/ubuntu}/entrypoint.sh | 0 9 files changed, 38 insertions(+), 102 deletions(-) delete mode 100644 base/debian/Dockerfile delete mode 100644 oses/debian/entrypoint.sh rename {base => oses}/ubuntu/Dockerfile (90%) rename {base => oses/ubuntu}/entrypoint.sh (100%) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 3812243..b1d79b5 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -1,4 +1,4 @@ -name: build base +name: build oses on: schedule: - cron: "0 0 * * 1" @@ -6,15 +6,16 @@ on: branches: - master paths: - - base/** + - oses/** jobs: push: - name: "yolks:base_${{ matrix.tag }}" + name: "yolks_os:${{ matrix.oses }}" runs-on: ubuntu-latest strategy: fail-fast: false matrix: - tag: + oses: + - alpine - debian - ubuntu steps: @@ -30,9 +31,9 @@ jobs: password: ${{ secrets.REGISTRY_TOKEN }} - uses: docker/build-push-action@v2 with: - context: ./base/${{ matrix.tag }} - file: ./base/${{ matrix.tag }}/Dockerfile + context: ./oses/${{ matrix.oses }} + file: ./oses/${{ matrix.oses }}/Dockerfile platforms: linux/amd64 push: true tags: | - ghcr.io/parkervcp/yolks:base_${{ matrix.tag }} + ghcr.io/parkervcp/yolks_os:${{ matrix.oses }} diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index 23f194e..5dc539c 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -32,7 +32,7 @@ jobs: password: ${{ secrets.REGISTRY_TOKEN }} - uses: docker/build-push-action@v2 with: - context: ./bot + context: ./bot/${{ matrix.tag }} file: ./bot/${{ matrix.tag }}/Dockerfile platforms: linux/amd64 push: true diff --git a/README.md b/README.md index 9a3e3ae..2a6fc32 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ is tagged correctly. * `ghcr.io/parkervcp/yolks:alpine` * [debian](/oses/debian) * `ghcr.io/parkervcp/yolks:debian` +* [debian](/oses/ubuntu) + * `ghcr.io/parkervcp/yolks:ubuntu` ### [Cassandra](/cassandra) * [`cassandra_java8_python27`](/cassandra/cassandra_java8_python2) * `ghcr.io/parkervcp/yolks:cassandra_java11_python2` diff --git a/base/debian/Dockerfile b/base/debian/Dockerfile deleted file mode 100644 index 68978fe..0000000 --- a/base/debian/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM debian:buster-slim - -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" - -ENV DEBIAN_FRONTEND noninteractive - -## add container user -RUN useradd -m -d /home/container -s /bin/bash container - -RUN ln -s /home/container/ /nonexistent - -ENV USER=container HOME=/home/container - -## update base packages -RUN apt update \ - && apt upgrade -y - -## install dependencies -RUN apt install -y gcc g++ libgcc1 lib32gcc1 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 libicu63 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadbclient-dev libduktape203 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates tzdata \ - liblua5.3 libz-dev rapidjson-dev - -## configure locale -RUN update-locale lang=en_US.UTF-8 \ - && dpkg-reconfigure --frontend noninteractive locales - -WORKDIR /home/container - -COPY ./entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/bot/red/Dockerfile b/bot/red/Dockerfile index 77469b5..29cf0a9 100644 --- a/bot/red/Dockerfile +++ b/bot/red/Dockerfile @@ -16,4 +16,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"] diff --git a/oses/debian/Dockerfile b/oses/debian/Dockerfile index ecf0b0f..68978fe 100644 --- a/oses/debian/Dockerfile +++ b/oses/debian/Dockerfile @@ -1,23 +1,30 @@ -FROM --platform=linux/amd64 debian:buster-slim +FROM debian:buster-slim -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT +ENV DEBIAN_FRONTEND noninteractive -RUN apt update && apt upgrade -y \ - && apt install -y gcc g++ libgcc1 lib32gcc1 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 libicu63 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadbclient-dev libduktape203 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates tzdata \ - liblua5.3 libz-dev rapidjson-dev \ - && update-locale lang=en_US.UTF-8 \ - && dpkg-reconfigure --frontend noninteractive locales \ - && useradd -m -d /home/container -s /bin/bash container +## add container user +RUN useradd -m -d /home/container -s /bin/bash container -USER container -ENV USER=container HOME=/home/container -ENV DEBIAN_FRONTEND noninteractive +RUN ln -s /home/container/ /nonexistent -WORKDIR /home/container +ENV USER=container HOME=/home/container -COPY ./entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +## update base packages +RUN apt update \ + && apt upgrade -y + +## install dependencies +RUN apt install -y gcc g++ libgcc1 lib32gcc1 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 libicu63 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadbclient-dev libduktape203 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates tzdata \ + liblua5.3 libz-dev rapidjson-dev + +## configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales + +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/oses/debian/entrypoint.sh b/oses/debian/entrypoint.sh deleted file mode 100644 index 7fecb8b..0000000 --- a/oses/debian/entrypoint.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2021 Matthew Penner -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# 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}') -export INTERNAL_IP - -# Switch to the container's working directory -cd /home/container || exit 1 - -# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell -# variable format of "${VARIABLE}" before evaluating the string and automatically -# replacing the values. -PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)") - -# Display the command we're running in the output, and then execute it with the env -# from the container itself. -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" -# shellcheck disable=SC2086 -exec env ${PARSED} diff --git a/base/ubuntu/Dockerfile b/oses/ubuntu/Dockerfile similarity index 90% rename from base/ubuntu/Dockerfile rename to oses/ubuntu/Dockerfile index 881ad46..cd62503 100644 --- a/base/ubuntu/Dockerfile +++ b/oses/ubuntu/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.04 -LABELauthor="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" ENV DEBIAN_FRONTEND noninteractive @@ -21,4 +21,4 @@ RUN update-locale lang=en_US.UTF-8 \ && dpkg-reconfigure --frontend noninteractive locales COPY ./entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/base/entrypoint.sh b/oses/ubuntu/entrypoint.sh similarity index 100% rename from base/entrypoint.sh rename to oses/ubuntu/entrypoint.sh