feat: add PostgreSQL/MongoDB Images and fix multiarch (#40)

add PostgreSQL/MongoDB Images and fixes multi-arch builds for MariaDB, Redis.
This commit is contained in:
Torsten Widmann
2022-01-25 16:08:35 +01:00
committed by GitHub
parent 68ef32ee2a
commit c263e42dac
20 changed files with 274 additions and 7 deletions

41
.github/workflows/mongodb.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: build mongodb
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- master
paths:
- mongodb/**
jobs:
push:
name: "yolks:mongodb_${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- 4
- 5
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- 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: ./mongodb
file: ./mongodb/${{ matrix.tag }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/parkervcp/yolks:mongodb_${{ matrix.tag }}

45
.github/workflows/postgres.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: build postgres
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- master
paths:
- postgres/**
jobs:
push:
name: "yolks:postgres_${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- 9
- 10
- 11
- 12
- 13
- 14
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- 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: ./postgres
file: ./postgres/${{ matrix.tag }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/parkervcp/yolks:postgres_${{ matrix.tag }}

View File

@@ -118,6 +118,12 @@ is tagged correctly.
* [`MariaDB 10.7`](/mariadb/10.7)
* `ghcr.io/parkervcp/yolks:mariadb_10.7`
### [MongoDB](/mongodb)
* [`MongoDB 4`](/mongodb/4)
* `ghcr.io/parkervcp/yolks:mongodb_4`
* [`MongoDB 5`](/mongodb/5)
* `ghcr.io/parkervcp/yolks:mongodb_5`
### [Mono](/mono)
* [`mono_latest`](/mono/latest)
* `ghcr.io/parkervcp/yolks:mono_latest`
@@ -133,6 +139,20 @@ is tagged correctly.
* [`node17`](/nodejs/17)
* `ghcr.io/parkervcp/yolks:nodejs_17`
### [PostgreSQL](/postgres)
* [`Postgres 9`](/postgres/9)
* `ghcr.io/parkervcp/yolks:postgres_9`
* [`Postgres 10`](/postgres/10)
* `ghcr.io/parkervcp/yolks:postgres_10`
* [`Postgres 11`](/postgres/11)
* `ghcr.io/parkervcp/yolks:postgres_11`
* [`Postgres 12`](/postgres/12)
* `ghcr.io/parkervcp/yolks:postgres_12`
* [`Postgres 13`](/postgres/13)
* `ghcr.io/parkervcp/yolks:postgres_13`
* [`Postgres 14`](/postgres/14)
* `ghcr.io/parkervcp/yolks:postgres_14`
### [Python](/python)
* [`python3.7`](/python/3.7)

View File

@@ -1,7 +1,7 @@
# -----------------------------------------------------
# MariaDB Image for Pterodactyl
# -----------------------------------------------------
FROM mariadb:10.3
FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.3
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"

View File

@@ -1,7 +1,7 @@
# -----------------------------------------------------
# MariaDB Image for Pterodactyl
# -----------------------------------------------------
FROM mariadb:10.4
FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.4
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"

View File

@@ -1,7 +1,7 @@
# -----------------------------------------------------
# MariaDB Image for Pterodactyl
# -----------------------------------------------------
FROM mariadb:10.5
FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.5
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"

View File

@@ -1,7 +1,7 @@
# -----------------------------------------------------
# MariaDB Image for Pterodactyl
# -----------------------------------------------------
FROM mariadb:10.6
FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.6
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"

View File

@@ -1,7 +1,7 @@
# -----------------------------------------------------
# MariaDB Image for Pterodactyl
# -----------------------------------------------------
FROM mariadb:10.7
FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.7
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"

19
mongodb/4/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
# ----------------------------------
# Environment: MongoDB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH mongo:4-focal
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y \
&& apt install -y netcat iproute2 \
&& useradd -d /home/container -m container -s /bin/bash
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

19
mongodb/5/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
# ----------------------------------
# Environment: MongoDB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH mongo:5-focal
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y \
&& apt install -y netcat iproute2 \
&& useradd -d /home/container -m container -s /bin/bash
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

12
mongodb/entrypoint.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
cd /home/container
# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
# Replace Startup Variables
MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo ":/home/container$ ${MODIFIED_STARTUP}"
# Run the Server
eval ${MODIFIED_STARTUP}

16
postgres/10/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ----------------------------------
# Environment: Postgres DB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH postgres:10-alpine
LABEL author="Parker" maintainer="parker@pterodactyl.io"
# UID 999 is the default pterodactyl user
RUN adduser -D -h /home/container container
USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

16
postgres/11/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ----------------------------------
# Environment: Postgres DB
# -----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH postgres:11-alpine
LABEL author="Parker" maintainer="parker@pterodactyl.io"
# UID 999 is the default pterodactyl user
RUN adduser -D -h /home/container container
USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

16
postgres/12/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ----------------------------------
# Environment: Postgres DB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH postgres:12-alpine
LABEL author="Parker" maintainer="parker@pterodactyl.io"
# UID 999 is the default pterodactyl user
RUN adduser -D -h /home/container container
USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

16
postgres/13/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ----------------------------------
# Environment: Postgres DB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH postgres:13-alpine
LABEL author="Parker" maintainer="parker@pterodactyl.io"
# UID 999 is the default pterodactyl user
RUN adduser -D -h /home/container container
USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

16
postgres/14/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ----------------------------------
# Environment: Postgres DB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH postgres:14-alpine
LABEL author="Parker" maintainer="parker@pterodactyl.io"
# UID 999 is the default pterodactyl user
RUN adduser -D -h /home/container container
USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

16
postgres/9/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# ----------------------------------
# Environment: Postgres DB
# ----------------------------------
FROM --platform=$TARGETOS/$TARGETARCH postgres:9-alpine
LABEL author="Parker" maintainer="parker@pterodactyl.io"
# UID 999 is the default pterodactyl user
RUN adduser -D -h /home/container container
USER container
ENV HOME /home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

15
postgres/entrypoint.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/ash
cd /home/container
#output current postgres version
postgres --version
# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
# Replace Startup Variables
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
echo ":/home/container$ ${MODIFIED_STARTUP}"
# Run the Server
eval ${MODIFIED_STARTUP}

View File

@@ -1,7 +1,7 @@
# ----------------------------------
# Environment: redis
# ----------------------------------
FROM redis:5-bullseye
FROM --platform=$TARGETOS/$TARGETARCH redis:5-bullseye
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"

View File

@@ -1,7 +1,7 @@
# ----------------------------------
# Environment: redis
# ----------------------------------
FROM redis:6-bullseye
FROM --platform=$TARGETOS/$TARGETARCH redis:6-bullseye
LABEL author="Michael Parker" maintainer="parker@pterodactyl.io"