mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-08-22 15:03:20 +00:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d3e461b4c | ||
|
|
fd73417411 | ||
|
|
1207b9a685 | ||
|
|
e6259bfd9d | ||
|
|
b5e7b952e4 | ||
|
|
ac5b960182 | ||
|
|
3299dec733 | ||
|
|
578f06087f | ||
|
|
fb364e8301 |
@@ -1,16 +1,14 @@
|
|||||||
version: 2.1
|
version: 2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
minecraft_server:
|
minecraft_server:
|
||||||
docker:
|
docker:
|
||||||
- image: docker:18.09.6
|
- image: circleci/buildpack-deps:19.10
|
||||||
environment:
|
|
||||||
DOCKER_BUILDKIT: "1"
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- setup_remote_docker:
|
- setup_remote_docker
|
||||||
version: 18.09.3
|
- run:
|
||||||
- run: docker build --platform linux/amd64,linux/arm64,linux/arm/v7 -t itzg/minecraft-server:multiarch .
|
name: Build image
|
||||||
|
command: docker build -t mc:$CIRCLE_BUILD_NUM .
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|||||||
+21
-19
@@ -1,34 +1,36 @@
|
|||||||
FROM ubuntu:18.04
|
FROM adoptopenjdk/openjdk13:alpine-jre
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
LABEL maintainer "itzg"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apk add --no-cache -U \
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
openssl \
|
||||||
apt-get install -y \
|
imagemagick \
|
||||||
openjdk-8-jre-headless \
|
lsof \
|
||||||
imagemagick \
|
su-exec \
|
||||||
gosu \
|
shadow \
|
||||||
curl wget \
|
bash \
|
||||||
jq \
|
curl iputils wget \
|
||||||
dos2unix \
|
git \
|
||||||
mysql-client \
|
jq \
|
||||||
tzdata \
|
mysql-client \
|
||||||
rsync \
|
tzdata \
|
||||||
nano \
|
rsync \
|
||||||
&& apt-get clean
|
nano
|
||||||
|
|
||||||
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
||||||
|
|
||||||
RUN addgroup --gid 1000 minecraft \
|
RUN addgroup -g 1000 minecraft \
|
||||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||||
|
&& mkdir -m 777 /data \
|
||||||
|
&& chown minecraft:minecraft /data /home/minecraft
|
||||||
|
|
||||||
EXPOSE 25565 25575
|
EXPOSE 25565 25575
|
||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||||
ARG TARGETOS=linux
|
ARG TARGETOS=linux
|
||||||
ARG TARGETARCH=arm
|
ARG TARGETARCH=amd64
|
||||||
ARG TARGETVARIANT=v7
|
ARG TARGETVARIANT=""
|
||||||
|
|
||||||
ARG EASY_ADD_VER=0.7.1
|
ARG EASY_ADD_VER=0.7.1
|
||||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if [ $(id -u) = 0 ]; then
|
|||||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec gosu ${runAsUser}:${runAsGroup} /start-configuration $@
|
exec su-exec ${runAsUser}:${runAsGroup} /start-configuration $@
|
||||||
else
|
else
|
||||||
exec /start-configuration $@
|
exec /start-configuration $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
+9
-2
@@ -7,8 +7,6 @@ shopt -s nullglob
|
|||||||
#umask 002
|
#umask 002
|
||||||
export HOME=/data
|
export HOME=/data
|
||||||
|
|
||||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
|
||||||
|
|
||||||
if [ ! -e /data/eula.txt ]; then
|
if [ ! -e /data/eula.txt ]; then
|
||||||
EULA="${EULA,,}"
|
EULA="${EULA,,}"
|
||||||
if [ "$EULA" != "true" ]; then
|
if [ "$EULA" != "true" ]; then
|
||||||
@@ -30,6 +28,15 @@ if [ ! -e /data/eula.txt ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||||
|
|
||||||
|
if ! touch /data/.verify_access; then
|
||||||
|
log "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm /data/.verify_access || true
|
||||||
|
|
||||||
if [[ $PROXY ]]; then
|
if [[ $PROXY ]]; then
|
||||||
export http_proxy="$PROXY"
|
export http_proxy="$PROXY"
|
||||||
export https_proxy="$PROXY"
|
export https_proxy="$PROXY"
|
||||||
|
|||||||
Reference in New Issue
Block a user