diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 66f6e84..429ec74 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -71,6 +71,8 @@ jobs: env: GAME: ${{ env.GAME }} FLAG: ${{ env.FLAG }} + VERSION: beta + IMAGE: jives/hlds:${{ matrix.game }}-beta with: context: ./container push: true @@ -78,6 +80,8 @@ jobs: build-args: | GAME=${{ env.GAME }} FLAG=${{ env.FLAG }} + IMAGE=jives/hlds:${{ matrix.game }}-beta + VERSION=beta - name: Set repo owner to lowercase id: repo_owner @@ -88,6 +92,8 @@ jobs: env: GAME: ${{ env.GAME }} FLAG: ${{ env.FLAG }} + VERSION: beta + IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta with: context: ./container push: true @@ -95,3 +101,5 @@ jobs: build-args: | GAME=${{ env.GAME }} FLAG=${{ env.FLAG }} + VERSION=beta + IMAGE=ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b06a282..4de2bad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true - DEFAULT_BUMP: patch DRY_RUN: true build: @@ -91,6 +90,8 @@ jobs: env: GAME: ${{ env.GAME }} FLAG: ${{ env.FLAG }} + VERSION: ${{ needs.version.outputs.version }} + IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }} with: context: ./container push: true @@ -100,6 +101,8 @@ jobs: build-args: | GAME=${{ env.GAME}} FLAG=${{ env.FLAG }} + VERSION=${{ needs.version.outputs.version }} + IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }} - name: Set repo owner to lowercase id: repo_owner @@ -110,6 +113,8 @@ jobs: env: GAME: ${{ matrix.game }} FLAG: ${{ env.FLAG }} + VERSION: ${{ needs.version.outputs.version }} + IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }} with: context: ./container push: true @@ -119,6 +124,8 @@ jobs: build-args: | GAME=${{ env.GAME }} FLAG=${{ env.FLAG }} + VERSION=${{ needs.version.outputs.version }} + IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }} publish: needs: build diff --git a/README.md b/README.md index dab71e2..b25d960 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ docker run -d \ -p 27015:27015 \ -p 26900:26900/udp \ -e GAME=${GAME} \ - jives/hlds:cstrike \ - "+log on +rcon_password changeme +maxplayers 12 +map cs_italy" # 📣 Modify your server startup commands here. You can specify the image with the desired game you want the server to run in the line above. + jives/hlds:valve \ + "+log on +rcon_password changeme +maxplayers 12 +map crossfire" # 📣 Modify your server startup commands here. You can specify the image with the desired game you want the server to run in the line above. ``` > [!TIP] diff --git a/container/Dockerfile b/container/Dockerfile index b3ab569..3cc9d6f 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -1,14 +1,5 @@ FROM ubuntu:18.04 -LABEL org.opencontainers.image.title="hlds" -LABEL org.opencontainers.image.description="🐋 📦 Half-Life Dedicated Server powered by Docker. Supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins." -LABEL org.opencontainers.image.vendor="https://jamesiv.es" -LABEL org.opencontainers.image.authors="James Ives" -LABEL org.opencontainers.image.licenses="MIT" -LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker" -LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker" -LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker" - # Sets an environment variable for the game to install. # Supported games: valve, cstrike, czero, dod, dmc, gearbox, ricochet, tfc # Default is valve. This get replaced when building the image with --build-arg GAME= @@ -21,6 +12,25 @@ ENV GAME ${GAME} ARG FLAG ENV FLAG ${FLAG} +# Sets an environment variable for the version of the image. +ARG VERSION=custom +ENV VERSION ${VERSION} + +# Sets an environment variable for the image name. +ARG IMAGE=custom +ENV IMAGE ${IMAGE} + +# Tags the image with the Open Containers Initiative (OCI) image format. +LABEL org.opencontainers.image.title="hlds:${GAME}" +LABEL org.opencontainers.image.description="🐋 📦 Half-Life Dedicated Server powered by Docker. Supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins." +LABEL org.opencontainers.image.vendor="https://jamesiv.es" +LABEL org.opencontainers.image.authors="James Ives (https://jamesiv.es)" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker" +LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker" +LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker" +LABEL org.opencontainers.image.version="${VERSION}" + RUN dpkg --add-architecture i386 && \ apt-get update && \ apt-get install -y --no-install-recommends curl rsync file libc6:i386 lib32stdc++6 ca-certificates && \ @@ -60,4 +70,5 @@ COPY --chown=steam:steam mods . RUN chmod +x ./entrypoint.sh -ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file + +ENTRYPOINT ["./entrypoint.sh"] diff --git a/container/docker-compose.yml b/container/docker-compose.yml index 9049202..8c0364e 100644 --- a/container/docker-compose.yml +++ b/container/docker-compose.yml @@ -5,6 +5,8 @@ services: args: - GAME=${GAME} - FLAG=${FLAG} + - VERSION=${VERSION} + - IMAGE=${IMAGE} volumes: - "./config:/temp/config" - "./mods:/temp/mods" @@ -15,4 +17,6 @@ services: environment: - GAME=${GAME} - FLAG=${FLAG} - command: +maxplayers 12 +log on + - VERSION=${VERSION} + - IMAGE=${IMAGE} + command: +maxplayers 12 +log on +rcon_password "changeme" +map crossfire diff --git a/container/entrypoint.sh b/container/entrypoint.sh index 0b76d03..318730c 100644 --- a/container/entrypoint.sh +++ b/container/entrypoint.sh @@ -1,7 +1,8 @@ #!/usr/bin/env sh -# Set GAME to its value if defined, or 'valve' if not GAME=${GAME:-valve} +VERSION=${VERSION:-custom} +IMAGE=${IMAGE:-custom} if echo "$@" | grep -qv "+map"; then echo -e "\e[33mWarning: No +map specified in the command. Server will start but may not be joinable.\e[0m" @@ -18,7 +19,46 @@ then rsync --chown=steam:steam /temp/config/* /opt/steam/hlds/$GAME fi -echo -e "\e[32mStarting Half-Life Dedicated Server for $GAME...\e[0m" + +echo " + ..::::::.. + :-=++++++++++++=-: + :=++++=--::...::-=++++=: + :=+++=: :-++++: + =+++- =====: -+++= + ++++. ===+++. .=+++ + =+++ :+++ =+++ + :+++. -+++= .+++: + =++= =+++++- =++= + =++- .=++-:+++: -+++ + =++= .+++- -+++. =++= + :+++. :+++. =+++ .+++: + =+++ =++=. ++++++= =++= + =+++. -==- .+++=-: .=+++ + =+++-. -+++= + :=+++=: :=+++=: + :=+++++=-::..::-=+++++=: + :-=++++++++++++=-: + ..::::::.. + + hlds-docker + +==================================================================== +💿 Image: $IMAGE +📎 Version: $VERSION +🎮 Game: $GAME +==================================================================== + +▄▄ LINKS ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ +█ █ +█ 🔧 Maintained by Jives: https://jives.dev █ +█ 💖 Support: https://github.com/sponsors/JamesIves █ +█ 🔔 Feedback / Issues: https://github.com/JamesIves/hlds-docker █ +█ █ +▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ +" + +echo "\e[32mStarting Half-Life Dedicated Server...\e[0m" # Start the server with the specified game and any additional arguments. ./hlds_run "-game $GAME $@" diff --git a/docker-compose.yml b/docker-compose.yml index 4e5e874..b8b1bdb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: # 🔧 jives/hlds:valve-legacy (Half-Life Deathmatch) (Pre 25th Anniversary Edition) # 🔧 jives/hlds:cstrike-legacy (Counter-Strike) (Pre 25th Anniversary Edition) # 🔧 jives/hlds:czero-legacy (Counter-Strike: Condition Zero) (Pre 25th Anniversary Edition) - image: jives/hlds:cstrike + image: jives/hlds:valve # 📣 Learn more about these volumes in the advanced setup guides: https://github.com/JamesIves/hlds-docker?tab=readme-ov-file#advanced-setup-%EF%B8%8F volumes: - "./config:/temp/config" @@ -26,4 +26,4 @@ services: # 📣 Modify your server startup commands here, you can add more FLAG as needed (see: https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server), # 📣 Remember: Stating map is based on the game, and will likely be different between images. # 📣 You should also modify the rcon_password value so you can use server admin commands. - command: +log on +rcon_password "changeme" +maxplayers 12 +map cs_italy + command: +log on +rcon_password "changeme" +maxplayers 12 +map crossfire