Skip to content

Commit

Permalink
feat: pass ANSIBLE_CONFIG to server config by default
Browse files Browse the repository at this point in the history
chore: Add openssh to minecraft image for git ssh cloning
chore: Install ansible-core and only the collections we need to reduce image size
chore: Bump keepup
  • Loading branch information
0ffz committed Mar 23, 2024
1 parent ed82d8e commit 698da29
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
3 changes: 3 additions & 0 deletions config/ansible-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
collections:
- community.general
- ansible.posix
21 changes: 14 additions & 7 deletions minecraft.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
FROM itzg/minecraft-server:java17-alpine
LABEL org.opencontainers.image.authors="Offz <offz@mineinabyss.com>"

RUN apk add --no-cache ansible rclone wget unzip jq
RUN apk add --no-cache ansible-core rclone wget unzip jq openssh

ARG KEEPUP_VERSION=2.0.0-beta.3
ARG KEEPUP_VERSION=2.0.1

ENV\
KEEPUP=true\
Expand All @@ -17,23 +17,30 @@ ENV\
ANSIBLE_PULL=true\
ANSIBLE_PULL_BRANCH=master\
SERVER_NAME=dev\
HOME=/data
HOME=/data\
ANSIBLE_CONFIG=/server-config/ansible.cfg

WORKDIR /opt/minecraft

# Install YourKit Java Profiler agents
RUN wget https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2023.9-docker.zip -P /tmp/ && \
unzip /tmp/YourKit-JavaProfiler-2023.9-docker.zip -d /usr/local && \
rm /tmp/YourKit-JavaProfiler-2023.9-docker.zip
#RUN wget -q https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2023.9-docker.zip -P /tmp/ && \
# unzip /tmp/YourKit-JavaProfiler-2023.9-docker.zip -d /usr/local && \
# rm /tmp/YourKit-JavaProfiler-2023.9-docker.zip

# Install keepup
RUN wget -nv -O keepup.zip https://github.com/MineInAbyss/Keepup/releases/download/v${KEEPUP_VERSION}/keepup-shadow-${KEEPUP_VERSION}.zip \
RUN wget -nv -q -O keepup.zip https://github.com/MineInAbyss/Keepup/releases/download/v${KEEPUP_VERSION}/keepup-shadow-${KEEPUP_VERSION}.zip \
# unzip file inside hocon-to-json.zip into /usr/local \
&& unzip -q keepup.zip \
&& rclone copy keepup-shadow-${KEEPUP_VERSION}/ /usr/local \
&& chmod +x /usr/local/bin/keepup \
&& rm -rf keepup.zip keepup-shadow-${KEEPUP_VERSION}

# Install ansible collections
COPY config/ansible-requirements.yml /opt/ansible/requirements.yml

RUN ansible-galaxy collection install -r /opt/ansible/requirements.yml -p /opt/ansible/collections \
&& rm /opt/ansible/requirements.yml

# Copy over scripts
COPY scripts/dev /scripts/dev
RUN chmod +x /scripts/dev/*
Expand Down
14 changes: 11 additions & 3 deletions proxy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ LABEL org.opencontainers.image.authors="Offz <offz@mineinabyss.com>"
RUN apt-get update -y \
&& apt-get install -y rsync rclone wget unzip git pipx python3-venv jq

RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install --include-deps ansible
# Install ansible
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install ansible-core

ARG KEEPUP_VERSION=2.0.0-beta.3
# Install ansible collections
COPY config/ansible-requirements.yml /opt/ansible/requirements.yml

RUN ansible-galaxy collection install -r /opt/ansible/requirements.yml -p /opt/ansible/collections \
&& rm /opt/ansible/requirements.yml

ARG KEEPUP_VERSION=2.0.1

ENV\
KEEPUP=true\
Expand All @@ -20,7 +27,8 @@ ENV\
ANSIBLE_PULL=true\
ANSIBLE_PULL_BRANCH=master\
SERVER_NAME=dev\
HOME=/server
HOME=/server\
ANSIBLE_CONFIG=/server-config/ansible.cfg

WORKDIR /opt/minecraft

Expand Down

0 comments on commit 698da29

Please sign in to comment.