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?).
This commit is contained in:
Softwarenoob
2021-08-06 23:20:24 +03:00
parent ba43d5ab59
commit 36f90183e2
9 changed files with 38 additions and 102 deletions

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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`

View File

@@ -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"]

View File

@@ -16,4 +16,4 @@ ENV USER=container HOME=/home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
CMD ["/bin/bash", "/entrypoint.sh"]

View File

@@ -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"]

View File

@@ -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}

View File

@@ -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"]
CMD ["/bin/bash", "/entrypoint.sh"]