From eb515743e7b54bf9a6d0d0d4999cc6531033dbd7 Mon Sep 17 00:00:00 2001 From: Softwarenoob Date: Fri, 6 Aug 2021 22:18:34 +0300 Subject: [PATCH] feat: add base_ubuntu and base_debian images Base images that self-hosted with other images importing these to build the image --- .github/workflows/base.yml | 16 ++++++++-------- base/debian/Dockerfile | 30 ++++++++++++++++++++++++++++++ base/entrypoint.sh | 12 ++++++++++++ base/ubuntu/Dockerfile | 24 ++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 base/debian/Dockerfile create mode 100644 base/entrypoint.sh create mode 100644 base/ubuntu/Dockerfile diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index d33a00f..3812243 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -1,4 +1,4 @@ -name: build oses +name: build base on: schedule: - cron: "0 0 * * 1" @@ -6,17 +6,17 @@ on: branches: - master paths: - - oses/** + - base/** jobs: push: - name: "yolks:${{ matrix.oses }}" + name: "yolks:base_${{ matrix.tag }}" runs-on: ubuntu-latest strategy: fail-fast: false matrix: - oses: - - alpine + tag: - debian + - ubuntu steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 @@ -30,9 +30,9 @@ jobs: password: ${{ secrets.REGISTRY_TOKEN }} - uses: docker/build-push-action@v2 with: - context: ./oses/${{ matrix.oses }} - file: ./oses/${{ matrix.oses }}/Dockerfile + context: ./base/${{ matrix.tag }} + file: ./base/${{ matrix.tag }}/Dockerfile platforms: linux/amd64 push: true tags: | - ghcr.io/parkervcp/yolks:${{ matrix.oses }} \ No newline at end of file + ghcr.io/parkervcp/yolks:base_${{ matrix.tag }} diff --git a/base/debian/Dockerfile b/base/debian/Dockerfile new file mode 100644 index 0000000..6b0f74e --- /dev/null +++ b/base/debian/Dockerfile @@ -0,0 +1,30 @@ +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/base/entrypoint.sh b/base/entrypoint.sh new file mode 100644 index 0000000..d9f5b44 --- /dev/null +++ b/base/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;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} \ No newline at end of file diff --git a/base/ubuntu/Dockerfile b/base/ubuntu/Dockerfile new file mode 100644 index 0000000..ed3bc61 --- /dev/null +++ b/base/ubuntu/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:20.04 + +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 + +## 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 libicu60 libiculx60 icu-devtools libunwind8 libssl1.0.0 libssl1.0-dev sqlite3 libsqlite3-dev libmariadbclient-dev libduktape202 libzip4 locales ffmpeg apt-transport-https init-system-helpers \ + libcurl3-gnutls libjsoncpp1 libleveldb1v5 liblua5.1-0 libluajit-5.1-2 libsqlite3-0 libfluidsynth1 bzip2 zlib1g + +## configure locale +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