From 7d5ac82726ff400fa0042c576284ff8f4b9a2092 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 19 Jun 2024 11:14:59 -0500 Subject: [PATCH] Publish as itzg/mc-proxy and also publish to GHCR (#185) --- .github/workflows/build.yml | 10 ++++ README.md | 47 ++++++++++++++----- docs/docker-compose.yml | 13 ++--- .../proxy/docker-compose.yml | 2 +- docs/velocity/docker-compose.yml | 2 +- docs/waterfall/docker-compose.yml | 2 +- 6 files changed, 54 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbbea27..41534dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,8 @@ jobs: with: images: | ${{ env.DOCKER_HUB_ORG }}/bungeecord + ${{ env.DOCKER_HUB_ORG }}/mc-proxy + ghcr.io/${{ github.repository_owner }}/mc-proxy tags: | # For the "main" variant, it gets the tag as-is, without suffix type=ref,event=tag,enable=${{ matrix.variant == env.MAIN_VARIANT }} @@ -80,6 +82,14 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v3.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - name: Build and push id: docker_build uses: docker/build-push-action@v5.4.0 diff --git a/README.md b/README.md index 5ac9526..a51d746 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ - -This is a Docker image of [BungeeCord](https://www.spigotmc.org/wiki/bungeecord/) -and is intended to be used at the front-end of a cluster of -[itzg/minecraft-server](https://hub.docker.com/r/itzg/minecraft-server/) containers. +This is a Docker image that provides a choice of Minecraft proxies, such as [BungeeCord](https://www.spigotmc.org/wiki/bungeecord/) and [Velocity](https://papermc.io/software/velocity). It is intended to be used in combination with [itzg/minecraft-server](https://hub.docker.com/r/itzg/minecraft-server/) containers. [![Build and Publish](https://github.com/itzg/docker-bungeecord/actions/workflows/build.yml/badge.svg)](https://github.com/itzg/docker-bungeecord/actions/workflows/build.yml) @@ -14,13 +11,37 @@ you can disable online mode, which is required by bungeecord, by setting `ONLINE docker run ... -e ONLINE_MODE=FALSE itzg/minecraft-server ``` -[Here](docs/docker-compose.yml) is an example Docker Compose file. +The following is an example that can be started with `docker compose up -d`: + +```yaml +services: + mc: + image: itzg/minecraft-server + environment: + EULA: "TRUE" + ONLINE_MODE: "FALSE" + volumes: + - mc-data:/data + proxy: + image: itzg/mc-proxy + environment: + BUNGEE_JAR_REVISION: "1" + CFG_MOTD: Powered by Docker + REPLACE_ENV_VARIABLES: "true" + ports: + - "25565:25577" + volumes: + - ./config.yml:/config/config.yml + - proxy-data:/server + +volumes: + mc-data: + proxy-data: +``` ## Healthcheck -This image contains [mc-monitor](https://github.com/itzg/mc-monitor) and uses -its `status` command to continually check on the container's. That can be observed -from the `STATUS` column of `docker ps` +This image contains [mc-monitor](https://github.com/itzg/mc-monitor) and uses its `status` command to continually check on the container's. That can be observed from the `STATUS` column of `docker ps` ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES @@ -241,7 +262,7 @@ _The `-i` is not needed in this case._ In order to attach and interact with the Bungeecord server, add `-it` when starting the container, such as - docker run -d -it -p 25565:25577 --name mc itzg/bungeecord + docker run -d -it -p 25565:25577 --name mc itzg/mc-proxy With that you can attach and interact at any time using @@ -312,7 +333,7 @@ version: "3.8" services: proxy: - image: itzg/bungeecord + image: itzg/mc-proxy ports: - "25577:25577" volumes: @@ -395,7 +416,7 @@ Supports the file formats: This image may be run as a non-root user but does require an attached `/server` volume that is writable by that uid, such as: - docker run ... -u $uid -v $(pwd)/data:/server itzg/bungeecord + docker run ... -u $uid -v $(pwd)/data:/server itzg/mc-proxy ## Java Versions @@ -403,11 +424,11 @@ The `latest` image tag is based on Java 21, but alternate image tags are availab The image Java variant can be used as shown here: - itzg/bungeecord:{variant} + itzg/mc-proxy:{variant} or using release version, such as `2024.5.0` - itzg/bungeecord:{release}-{variant} + itzg/mc-proxy:{release}-{variant} | Variant | Java Version | CPU types | |---------|--------------|-------------------| diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml index 4599ad7..a32d4d0 100644 --- a/docs/docker-compose.yml +++ b/docs/docker-compose.yml @@ -1,13 +1,13 @@ -version: '3.5' - services: mc: image: itzg/minecraft-server environment: EULA: "TRUE" ONLINE_MODE: "FALSE" - bungeecord: - image: itzg/bungeecord + volumes: + - mc-data:/data + proxy: + image: itzg/mc-proxy environment: BUNGEE_JAR_REVISION: "1" CFG_MOTD: Powered by Docker @@ -16,7 +16,8 @@ services: - "25565:25577" volumes: - ./config.yml:/config/config.yml - - bungeecord:/server + - proxy-data:/server volumes: - bungeecord: {} + mc-data: + proxy-data: diff --git a/docs/multi-compose-projects/proxy/docker-compose.yml b/docs/multi-compose-projects/proxy/docker-compose.yml index 02c0fc1..c0177b1 100644 --- a/docs/multi-compose-projects/proxy/docker-compose.yml +++ b/docs/multi-compose-projects/proxy/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.8" services: proxy: - image: itzg/bungeecord + image: itzg/mc-proxy environment: TYPE: WATERFALL ports: diff --git a/docs/velocity/docker-compose.yml b/docs/velocity/docker-compose.yml index 864d03e..369fb0f 100644 --- a/docs/velocity/docker-compose.yml +++ b/docs/velocity/docker-compose.yml @@ -9,7 +9,7 @@ services: volumes: - ./paper-global.yml:/config/paper-global.yml proxy: - image: itzg/bungeecord + image: itzg/mc-proxy environment: TYPE: VELOCITY DEBUG: "false" diff --git a/docs/waterfall/docker-compose.yml b/docs/waterfall/docker-compose.yml index 88fdd2a..5e7adf4 100644 --- a/docs/waterfall/docker-compose.yml +++ b/docs/waterfall/docker-compose.yml @@ -6,7 +6,7 @@ services: TYPE: PAPER ONLINE_MODE: "FALSE" proxy: - image: itzg/bungeecord + image: itzg/mc-proxy environment: TYPE: WATERFALL ENABLE_RCON: "true"