diff --git a/.github/workflows/cassandra.yml b/.github/workflows/cassandra.yml new file mode 100644 index 0000000..1d61259 --- /dev/null +++ b/.github/workflows/cassandra.yml @@ -0,0 +1,38 @@ +name: build cassandra +on: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - cassandra/** +jobs: + push: + name: "yolks:cassandra_${{ matrix.tag }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tag: + - java8_python2 + - java11_python3 + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-buildx-action@v1 + with: + version: "v0.5.1" + buildkitd-flags: --debug + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + - uses: docker/build-push-action@v2 + with: + context: ./cassandra + file: ./cassandra/${{ matrix.tag }}/Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/parkervcp/yolks:cassandra_${{ matrix.tag }} diff --git a/README.md b/README.md index 547bbaa..9a3e3ae 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ is tagged correctly. * `ghcr.io/parkervcp/yolks:alpine` * [debian](/oses/debian) * `ghcr.io/parkervcp/yolks:debian` +### [Cassandra](/cassandra) + * [`cassandra_java8_python27`](/cassandra/cassandra_java8_python2) + * `ghcr.io/parkervcp/yolks:cassandra_java11_python2` + * [`cassandra_java11_python3`](/cassandra/cassandra_java11_python3) + * `ghcr.io/parkervcp/yolks:cassandra_java11_python3` ### [Erlang](/erlang) * [`erlang22`](/erlang/22) * `ghcr.io/parkervcp/yolks:erlang_22` @@ -87,4 +92,4 @@ is tagged correctly. * `ghcr.io/parkervcp/installers:alpine` * [`debian-install`](/installers/debian) - * `ghcr.io/parkervcp/installers:debian` \ No newline at end of file + * `ghcr.io/parkervcp/installers:debian` diff --git a/cassandra/entrypoint.sh b/cassandra/entrypoint.sh new file mode 100644 index 0000000..712088f --- /dev/null +++ b/cassandra/entrypoint.sh @@ -0,0 +1,33 @@ +#!/bin/ash + +# 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 + +# Print Python version +if command -v python &> /dev/null +then + printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython --version\n" + python --version +else + printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython3 --version\n" + python3 --version +fi + +# 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} diff --git a/cassandra/java11_python3/Dockerfile b/cassandra/java11_python3/Dockerfile new file mode 100644 index 0000000..9561cd8 --- /dev/null +++ b/cassandra/java11_python3/Dockerfile @@ -0,0 +1,16 @@ +FROM --platform=$BUILDPLATFORM adoptopenjdk/openjdk11:alpine-jre + +LABEL author="Pascal Zarrad" maintainer="p.zarrad@outlook.de" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --update --no-cache python3 ca-certificates curl fontconfig git openssl sqlite tar tzdata \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/cassandra/java8_python2/Dockerfile b/cassandra/java8_python2/Dockerfile new file mode 100644 index 0000000..3fa95c8 --- /dev/null +++ b/cassandra/java8_python2/Dockerfile @@ -0,0 +1,16 @@ +FROM --platform=$BUILDPLATFORM adoptopenjdk/openjdk8:alpine-jre + +LABEL author="Pascal Zarrad" maintainer="p.zarrad@outlook.de" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --update --no-cache python2 ca-certificates curl fontconfig git openssl sqlite tar tzdata \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ]