Add Base Debian (#5)

This commit is contained in:
Charles Morgan 2021-06-21 19:27:00 -04:00 committed by GitHub
parent 130bee2129
commit 88180b3f5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 82 additions and 6 deletions

View file

@ -1,4 +1,4 @@
name: build alpine
name: build oses
on:
schedule:
- cron: "0 0 * * 1"
@ -6,13 +6,17 @@ on:
branches:
- master
paths:
- alpine/**
- oses/**
jobs:
push:
name: "yolks:alpine"
name: "yolks:${{ matrix.oses }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
oses:
- alpine
- debian
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
@ -26,9 +30,9 @@ jobs:
password: ${{ secrets.REGISTRY_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: ./alpine
file: ./alpine/Dockerfile
context: ./oses/${{ matrix.oses }}
file: ./oses/${{ matrix.oses }}/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/pterodactyl/yolks:alpine
ghcr.io/pterodactyl/yolks:${{ matrix.oses }}

View file

@ -26,6 +26,10 @@ is tagged correctly.
## Available Images
* [`alpine`](https://github.com/pterodactyl/yolks/tree/master/oses/alpine)
* `ghcr.io/pterodactyl/yolks:alpine`
* [`debian`](https://github.com/pterodactyl/yolks/tree/master/oses/debian)
* `ghcr.io/pterodactyl/yolks:debian`
* [`fivem`](https://github.com/pterodactyl/yolks/tree/master/games/fivem)
* `ghcr.io/pterodactyl/games:fivem`
* [`golang`](https://github.com/pterodactyl/yolks/tree/master/go)

23
oses/debian/Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM --platform=linux/amd64 debian:buster-slim
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"
LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks"
LABEL org.opencontainers.image.licenses=MIT
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
USER container
ENV USER=container HOME=/home/container
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD [ "/bin/bash", "/entrypoint.sh" ]

45
oses/debian/entrypoint.sh Normal file
View file

@ -0,0 +1,45 @@
#!/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}