Skip to content
This repository was archived by the owner on Apr 23, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 220 additions & 0 deletions .github/workflows/multipaper.yml
Original file line number Diff line number Diff line change
@@ -1 +1,221 @@
name: Build Docker Images

on: [push, pull_request]
env:
TARGET_PLATFORMS_ALPINE: linux/amd64,linux/arm64,linux/arm/v7
TARGET_PLATFORMS_DEBIAN: linux/amd64,linux/arm64
TARGET_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7

jobs:

build-multipaper-docker-alpine:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
name: Checkout repository

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta for MultiPaperK8s/multipaper-init
id: multipaper-init-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/multipaper-init

- name: Build and push multipaper-init for ${{ env.TARGET_PLATFORMS_ALPINE }}
uses: docker/build-push-action@v3
with:
context: ./build/alpine
file: build/alpine/Dockerfile.init
platforms: ${{ env.TARGET_PLATFORMS_ALPINE }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-init-meta.outputs.tags }}
labels: ${{ steps.multipaper-init-meta.outputs.labels }}

build-multipaper-docker-debian:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
name: Checkout repository

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta for MultiPaperK8s/multipaper-master
id: multipaper-master-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/multipaper-master-debian-unstable

- name: Build and push multipaper-master for ${{ env.TARGET_PLATFORMS_DEBIAN }}
uses: docker/build-push-action@v3
with:
context: ./build/debian-slim
file: build/debian-slim/Dockerfile.master
platforms: ${{ env.TARGET_PLATFORMS_DEBIAN }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-master-meta.outputs.tags }}
labels: ${{ steps.multipaper-master-meta.outputs.labels }}

- name: Docker meta for MultiPaperK8s/multipaper
id: multipaper-server-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/multipaper-debian-unstable

- name: Build and push multipaper for ${{ env.TARGET_PLATFORMS_DEBIAN }}
uses: docker/build-push-action@v3
with:
context: ./build/debian-slim
file: build/debian-slim/Dockerfile.server
platforms: ${{ env.TARGET_PLATFORMS_DEBIAN }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-server-meta.outputs.tags }}
labels: ${{ steps.multipaper-server-meta.outputs.labels }}

build-multipaper-docker-ubuntu-jammy:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
name: Checkout repository

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta for MultiPaperK8s/multipaper-master
id: multipaper-master-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/multipaper-master-jammy

- name: Build and push multipaper-master for ${{ env.TARGET_PLATFORMS }}
uses: docker/build-push-action@v3
with:
context: ./build/ubuntu-jammy
file: build/ubuntu-jammy/Dockerfile.master
platforms: ${{ env.TARGET_PLATFORMS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-master-meta.outputs.tags }}
labels: ${{ steps.multipaper-master-meta.outputs.labels }}

- name: Docker meta for MultiPaperK8s/multipaper
id: multipaper-server-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/MultiPaperK8s/multipaper-jammy

- name: Build and push multipaper for ${{ env.TARGET_PLATFORMS }}
uses: docker/build-push-action@v3
with:
context: ./build/ubuntu-jammy
file: build/ubuntu-jammy/Dockerfile.server
platforms: ${{ env.TARGET_PLATFORMS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-server-meta.outputs.tags }}
labels: ${{ steps.multipaper-server-meta.outputs.labels }}

build-multipaper-docker-ubuntu-focal:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
name: Checkout repository

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta for MultiPaperK8s/multipaper-master-focal
id: multipaper-master-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/multipaper-master-focal

- name: Build and push multipaper-master for ${{ env.TARGET_PLATFORMS }}
uses: docker/build-push-action@v3
with:
context: ./build/ubuntu-focal
file: build/ubuntu-focal/Dockerfile.master
platforms: ${{ env.TARGET_PLATFORMS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-master-meta.outputs.tags }}
labels: ${{ steps.multipaper-master-meta.outputs.labels }}

- name: Docker meta for MultiPaperK8s/multipaper
id: multipaper-server-meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/MultiPaperK8s/multipaper-focal

- name: Build and push multipaper for ${{ env.TARGET_PLATFORMS }}
uses: docker/build-push-action@v3
with:
context: ./build/ubuntu-focal
file: build/ubuntu-focal/Dockerfile.server
platforms: ${{ env.TARGET_PLATFORMS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.multipaper-server-meta.outputs.tags }}
labels: ${{ steps.multipaper-server-meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tmp/
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add ubuntu-jammy distribution (build + Docker support)
- Add ubuntu-focal distribution (build + Docker support)

### Changed
- Update Eclipse Temurin Ubuntu image from 17.0.3_7-jre -> 17.0.5_8-jre-(jammy|focal)
- Update Eclipse Temurin Debian image from 17.0.3_7-jdk -> 17.0.5_8-jdk
- Update Debian slim image from stable-20220622-slim -> stable-20221205-slim
- Update Debian slim dependency tzdata (using bullseye-updates repository) 2021a-1+deb11u4 -> 2021a-1+deb11u8
- Update Debian slim dependency curl 7.74.0-1.3+deb11u1 -> 7.74.0-1.3+deb11u3
- Update Debian slim dependency locales 2.31-13+deb11u3 -> 2.31-13+deb11u4
- Docker images tags from Ubuntu generic to specific ((multipaper|multipaper-master) -> (multipaper|multipaper-master)-(jammy|focal))
- Update Alpine init image from Alpine 3.16.0 -> 3.17.0
- Update Alpine init image dependency libintl 0.21-r2 -> 0.21.1-r1
- Update Alpine init image dependency gettext 0.21-r2 -> 0.21.1-r1
- Downgrade Ubuntu focal dependency dumb-init 1.2.5-2 -> 1.2.2-1.2
- Building Debian Slim now only for AMD64 and ARM64v8 (Aarch64)
- Update Multipaper to 1.19.2

### Removed
- Generic ubuntu distribution

## [0.1.2] - 2022-06-07
### Changed
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4.1
FROM eclipse-temurin:17.0.3_7-jre-alpine
FROM eclipse-temurin:17.0.3_7-jre

# Versioning
ARG MULTIPAPER_VERSION=1.18.2
Expand All @@ -8,8 +8,8 @@ ARG MASTER_VERSION=2.8.8

# Setup groups and install dumb init
RUN addgroup --gid 1001 multipaper && \
adduser --home /multipaper --uid 1001 -S -G multipaper multipaper && \
apk add --no-cache dumb-init=1.2.5-r1
adduser --system --home /multipaper --uid 1001 --gid 1001 multipaper && \
apt update && apt install -y --no-install-recommends dumb-init=1.2.5-2

# Use the multipaper's home directory as our work directory
WORKDIR /multipaper
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4.1
FROM eclipse-temurin:17.0.3_7-jre-alpine
FROM eclipse-temurin:17.0.3_7-jre

# Versioning
ARG VERSION=1.18.2
Expand All @@ -8,8 +8,8 @@ ARG FULL_VERSION="$VERSION-$BUILD"

# Setup groups and install dumb init
RUN addgroup --gid 1001 multipaper && \
adduser --home /multipaper --uid 1001 -S -G multipaper multipaper && \
apk add --no-cache dumb-init=1.2.5-r1
adduser --system --home /multipaper --uid 1001 --gid 1001 multipaper && \
apt update && apt install -y --no-install-recommends dumb-init=1.2.5-2

# Use the multipaper's home directory as our work directory
WORKDIR /multipaper
Expand Down
12 changes: 12 additions & 0 deletions build/alpine/Dockerfile.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# syntax=docker/dockerfile:1.4.1
FROM alpine:3.17.0

RUN addgroup --gid 1001 multipaper && \
adduser --home /multipaper --uid 1001 -S -G multipaper multipaper

RUN apk add --no-cache --update libintl=0.21.1-r1 && \
apk add --no-cache --virtual build_deps gettext=0.21.1-r1 && \
cp /usr/bin/envsubst /usr/local/bin/envsubst && \
apk del build_deps

USER multipaper
59 changes: 59 additions & 0 deletions build/debian-slim/Dockerfile.master
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# syntax=docker/dockerfile:1.4.1
FROM eclipse-temurin:17.0.5_8-jdk AS jre-build

# Create a custom Java runtime for MultiPaper Server
RUN jlink \
--add-modules java.base,java.desktop,java.logging,java.naming,java.xml,jdk.sctp,jdk.unsupported \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /multipaper/java

FROM debian:stable-20221205-slim

# Initialising language
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

# Setting up Java
ENV JAVA_HOME=/opt/java/openjdk \
PATH="/opt/java/openjdk/bin:$PATH"

## Taken from eclipse-temurin setup, but with version pinning and dumb-init
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata=2021a-1+deb11u8 curl=7.74.0-1.3+deb11u3 ca-certificates=20210119 fontconfig=2.13.1-4.2 locales=2.31-13+deb11u4 binutils=2.35.2-2 dumb-init=1.2.5-1 \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*

# Copy over JRE
COPY --from=jre-build /multipaper/java $JAVA_HOME

# Versioning
ARG MULTIPAPER_VERSION=1.19.2
ARG MULTIPAPER_BUILD=37
ARG MASTER_VERSION=2.10.1

# Setup groups
RUN addgroup --gid 1001 multipaper && \
adduser --system --home /multipaper --uid 1001 --gid 1001 multipaper

# Use the multipaper's home directory as our work directory
WORKDIR /multipaper

# Switch from root to multipaper
USER multipaper

# Download multipaper
ADD --chown=multipaper:multipaper https://multipaper.io/api/v2/projects/multipaper/versions/$MULTIPAPER_VERSION/builds/$MULTIPAPER_BUILD/downloads/MultiPaper-Master-$MASTER_VERSION-all.jar multipaper-master.jar

# Expose the ports of the master server and proxy
EXPOSE 35353/tcp
EXPOSE 25565/tcp

# Start the process using dumb-init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["java", "-jar", "/multipaper/multipaper-master.jar"]

# Switch to the data directory
WORKDIR /multipaper/data
Loading