diff --git a/base/alpine/Dockerfile b/base/alpine/Dockerfile new file mode 100644 index 0000000..ebfe912 --- /dev/null +++ b/base/alpine/Dockerfile @@ -0,0 +1,19 @@ +FROM --platform=$TARGETOS/$TARGETARCH alpine:latest + +LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com" +LABEL upstream="https://github.com/pelican-eggs/yolks" + +RUN apk add --update --no-cache ca-certificates tzdata tini bash +RUN adduser -D -h /home/container container + +USER 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/alpine/entrypoint.sh b/base/alpine/entrypoint.sh new file mode 100644 index 0000000..16c8c20 --- /dev/null +++ b/base/alpine/entrypoint.sh @@ -0,0 +1,21 @@ +# 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-2);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') + +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@ariaos~ \033[0m" +echo "$PARSED" +# shellcheck disable=SC2086 +eval "$PARSED" \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..101148a --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + +docker build -t git.zontreck.com/ariascreations/yolks:alpine base/alpine +docker push git.zontreck.com/ariascreations/yolks:alpine \ No newline at end of file