diff --git a/Jenkinsfile b/Jenkinsfile index 7e96547..8546074 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,6 +22,8 @@ pipeline { docker build -t git.zontreck.com/ariascreations/yolks:alpine base/alpine docker build -t git.zontreck.com/ariascreations/yolks:debian base/debian + docker build -t git.zontreck.com/ariascreations/yolks:ubuntu base/ubuntu + docker build -t git.zontreck.com/ariascreations/yolks:arch base/arch ''' } } @@ -39,6 +41,8 @@ pipeline { docker push git.zontreck.com/ariascreations/yolks:alpine docker push git.zontreck.com/ariascreations/yolks:debian + docker push git.zontreck.com/ariascreations/yolks:ubuntu + docker push git.zontreck.com/ariascreations/yolks:arch ''' } } diff --git a/base/arch/Dockerfile b/base/arch/Dockerfile new file mode 100644 index 0000000..a2c7334 --- /dev/null +++ b/base/arch/Dockerfile @@ -0,0 +1,22 @@ +FROM archlinux:latest + +LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com" +LABEL upstream="https://github.com/pelican-eggs/yolks" + +RUN pacman -Sy +RUN echo "y" | pacman -Syu +RUN echo "y" | pacman -S base-devel git gcc cmake nasm + +RUN useradd -m -d /home/container -s /bin/bash container + +ENV USER=container HOME=/home/container + + +WORKDIR /home/container +STOPSIGNAL SIGINT + + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/bin/bash", "-c", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/base/arch/entrypoint.sh b/base/arch/entrypoint.sh new file mode 100644 index 0000000..8244bf9 --- /dev/null +++ b/base/arch/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# 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 diff --git a/base/ubuntu/Dockerfile b/base/ubuntu/Dockerfile new file mode 100644 index 0000000..b9c0dc7 --- /dev/null +++ b/base/ubuntu/Dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:22.04 + + +LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com" +LABEL upstream="https://github.com/pelican-eggs/yolks" + +ENV DEBIAN_FRONTEND noninteractive +RUN useradd -m -d /home/container -s /bin/bash container + +RUN ln -s /home/container/ /nonexistent +ENV USER=container HOME=/home/container + +RUN apt-get update +RUN apt-get upgrade -y + +RUN apt-get install -y build-essential 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 icu-devtools libunwind8 sqlite3 libsqlite3-dev libzip4 locales ffmpeg apt-transport-https init-system-helpers \ +libcurl3-gnutls liblua5.1-0 libluajit-5.1-2 libsqlite3-0 bzip2 zlib1g libevent-dev libmariadb-dev-compat libmariadb-dev libssl-dev \ +libfluidsynth-dev libmariadb-dev libicu-dev libssl3 libduktape207 libjsoncpp-dev libleveldb1d libncurses5 libncursesw5 + + +RUN update-locale en_US.UTF-8 +RUN dpkg-reconfigure --frontend noninteractive locales + +WORKDIR /home/container +STOPSIGNAL SIGINT + + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/bin/bash", "-c", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/base/ubuntu/entrypoint.sh b/base/ubuntu/entrypoint.sh new file mode 100644 index 0000000..8244bf9 --- /dev/null +++ b/base/ubuntu/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# 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 diff --git a/build.sh b/build.sh index ae50df1..e8f16b8 100755 --- a/build.sh +++ b/build.sh @@ -2,4 +2,6 @@ docker build -t git.zontreck.com/ariascreations/yolks:alpine base/alpine -docker build -t git.zontreck.com/ariascreations/yolks:debian base/debian \ No newline at end of file +docker build -t git.zontreck.com/ariascreations/yolks:debian base/debian +docker build -t git.zontreck.com/ariascreations/yolks:ubuntu base/ubuntu +docker build -t git.zontreck.com/ariascreations/yolks:arch base/arch \ No newline at end of file