mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-12 13:22:28 +00:00
build: accept build args for extra packages to install (#3060)
This commit is contained in:
parent
dd3c7a4b77
commit
222b522bc1
5 changed files with 23 additions and 4 deletions
|
@ -7,9 +7,14 @@ ARG TARGETOS
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
|
# The following three arg/env vars get used by the platform specific "install-packages" script
|
||||||
|
ARG EXTRA_DEB_PACKAGES=""
|
||||||
|
ARG EXTRA_DNF_PACKAGES=""
|
||||||
|
ARG EXTRA_ALPINE_PACKAGES=""
|
||||||
ARG FORCE_INSTALL_PACKAGES=1
|
ARG FORCE_INSTALL_PACKAGES=1
|
||||||
RUN --mount=target=/build,source=build \
|
RUN --mount=target=/build,source=build \
|
||||||
TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
TARGET=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
/build/run.sh install-packages
|
||||||
|
|
||||||
RUN --mount=target=/build,source=build \
|
RUN --mount=target=/build,source=build \
|
||||||
/build/run.sh setup-user
|
/build/run.sh setup-user
|
||||||
|
|
|
@ -4,6 +4,7 @@ set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Install necessary packages
|
# Install necessary packages
|
||||||
|
# shellcheck disable=SC2086
|
||||||
apk add --no-cache -U \
|
apk add --no-cache -U \
|
||||||
openssl \
|
openssl \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
|
@ -29,7 +30,8 @@ apk add --no-cache -U \
|
||||||
nfs-utils \
|
nfs-utils \
|
||||||
libpcap \
|
libpcap \
|
||||||
libwebp \
|
libwebp \
|
||||||
libcap
|
libcap \
|
||||||
|
${EXTRA_ALPINE_PACKAGES}
|
||||||
|
|
||||||
# Download and install patched knockd
|
# Download and install patched knockd
|
||||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
|
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
|
||||||
|
|
|
@ -23,6 +23,7 @@ EOF
|
||||||
dnf update -y
|
dnf update -y
|
||||||
|
|
||||||
# Install necessary packages
|
# Install necessary packages
|
||||||
|
# shellcheck disable=SC2086
|
||||||
dnf install -y \
|
dnf install -y \
|
||||||
ImageMagick \
|
ImageMagick \
|
||||||
file \
|
file \
|
||||||
|
@ -44,7 +45,8 @@ dnf install -y \
|
||||||
libpcap \
|
libpcap \
|
||||||
libwebp \
|
libwebp \
|
||||||
findutils \
|
findutils \
|
||||||
which
|
which \
|
||||||
|
${EXTRA_DNF_PACKAGES}
|
||||||
|
|
||||||
# Install Git LFS
|
# Install Git LFS
|
||||||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
|
||||||
|
|
|
@ -6,6 +6,7 @@ set -euo pipefail
|
||||||
|
|
||||||
# Update and install packages
|
# Update and install packages
|
||||||
apt-get update
|
apt-get update
|
||||||
|
# shellcheck disable=SC2086
|
||||||
DEBIAN_FRONTEND=noninteractive \
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
|
@ -26,7 +27,8 @@ apt-get install -y \
|
||||||
zstd \
|
zstd \
|
||||||
lbzip2 \
|
lbzip2 \
|
||||||
nfs-common \
|
nfs-common \
|
||||||
libpcap0.8
|
libpcap0.8 \
|
||||||
|
${EXTRA_DEB_PACKAGES}
|
||||||
|
|
||||||
# Install Git LFS
|
# Install Git LFS
|
||||||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
||||||
|
|
|
@ -26,3 +26,11 @@ or just a plain build
|
||||||
```shell
|
```shell
|
||||||
docker build -t IMG_PREFIX/minecraft-server .
|
docker build -t IMG_PREFIX/minecraft-server .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Installing extra packages
|
||||||
|
|
||||||
|
The following build args can be set to install additional packages for the respective base image distro:
|
||||||
|
|
||||||
|
- `EXTRA_DEB_PACKAGES`
|
||||||
|
- `EXTRA_DNF_PACKAGES`
|
||||||
|
- `EXTRA_ALPINE_PACKAGES`
|
||||||
|
|
Loading…
Reference in a new issue