Skip to content

Commit

Permalink
feat: add Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed May 5, 2024
1 parent 657453a commit 7625623
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 13 deletions.
50 changes: 45 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,50 @@ on:
- cron: "0 2 * * 6"

jobs:
build-ubuntu-2404:
name: Build Ubuntu 24.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/[email protected]

- name: Build
run: docker build -t gameservermanagers/linuxgsm:ubuntu-24.04 -f ./Dockerfile.ubuntu-2404 .

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push (Ubuntu 24.04)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile.ubuntu-2404
platforms: linux/amd64
push: true
tags: |
gameservermanagers/linuxgsm:latest
gameservermanagers/linuxgsm:ubuntu
gameservermanagers/linuxgsm:ubuntu-24.04
ghcr.io/gameservermanagers/linuxgsm:latest
ghcr.io/gameservermanagers/linuxgsm:ubuntu
ghcr.io/gameservermanagers/linuxgsm:ubuntu-24.04
build-ubuntu-2204:
name: Build Ubuntu 22.04
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,11 +91,7 @@ jobs:
platforms: linux/amd64
push: true
tags: |
gameservermanagers/linuxgsm:latest
gameservermanagers/linuxgsm:ubuntu
gameservermanagers/linuxgsm:ubuntu-22.04
ghcr.io/gameservermanagers/linuxgsm:latest
ghcr.io/gameservermanagers/linuxgsm:ubuntu
ghcr.io/gameservermanagers/linuxgsm:ubuntu-22.04
build-ubuntu-2004:
Expand Down Expand Up @@ -96,7 +136,7 @@ jobs:
package-cleanup:
name: Cleanup Old GitHub Packages
needs: [ build-ubuntu-2004, build-ubuntu-2204 ]
needs: [ build-ubuntu-2004, build-ubuntu-2204, build-ubuntu-2404 ]
runs-on: ubuntu-latest
steps:
- name: Delete Package Versions
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile.ubuntu-2004
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
lib32gcc-s1 \
lib32stdc++6 \
netcat \
pigz \
python3 \
sudo \
tar \
Expand All @@ -74,10 +75,7 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
# Install Node.js
RUN echo "**** Install Node.js ****" \
&& set -uex \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& NODE_MAJOR=20 \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& echo -e "X-Repolib-Name: nodesource\nURIs: https://deb.nodesource.com/node_20.x\nSigned-By: /etc/apt/keyrings/nodesource.asc\nSuites: nodistro\nComponents: main\nEnabled: yes\nArchitectures: x86_64\nTypes: deb" > /etc/apt/sources.list.d/nodesource.sources \
&& apt-get update \
&& apt-get install nodejs -y \
&& apt-get -y autoremove \
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile.ubuntu-2204
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
lib32gcc-s1 \
lib32stdc++6 \
netcat \
pigz \
python3 \
sudo \
tar \
Expand All @@ -75,10 +76,7 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
# Install Node.js
RUN echo "**** Install Node.js ****" \
&& set -uex \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& NODE_MAJOR=20 \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& echo -e "X-Repolib-Name: nodesource\nURIs: https://deb.nodesource.com/node_20.x\nSigned-By: /etc/apt/keyrings/nodesource.asc\nSuites: nodistro\nComponents: main\nEnabled: yes\nArchitectures: x86_64\nTypes: deb" > /etc/apt/sources.list.d/nodesource.sources \
&& apt-get update \
&& apt-get install nodejs -y \
&& apt-get -y autoremove \
Expand Down
137 changes: 137 additions & 0 deletions Dockerfile.ubuntu-2404
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#
# LinuxGSM Base Dockerfile
#
# https://github.com/GameServerManagers/docker-linuxgsm
#

FROM gameservermanagers/steamcmd:ubuntu-24.04

LABEL maintainer="LinuxGSM <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
ENV TERM=xterm
ENV LGSM_GITHUBUSER=GameServerManagers
ENV LGSM_GITHUBREPO=LinuxGSM
ENV LGSM_GITHUBBRANCH=master
ENV LGSM_LOGDIR=/data/log
ENV LGSM_SERVERFILES=/data/serverfiles
ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV LGSM_DEV=false
ENV GAMESERVER=jc2server
ENV UPDATE_CHECK=60
ENV USER=linuxgsm
ENV UID=1000
ENV GID=1000

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

## Install Base LinuxGSM Requirements
RUN echo "**** Install Base LinuxGSM Requirements ****" \
&& apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository multiverse \
&& add-apt-repository ppa:git-core/ppa \
&& apt-get update \
&& apt-get install -y \
bc \
binutils \
bsdmainutils \
bzip2 \
ca-certificates \
cpio \
cron \
curl \
distro-info \
file \
git \
gnupg \
gosu \
gzip \
hostname \
jq \
lib32gcc-s1 \
lib32stdc++6 \
netcat-openbsd \
pigz \
python3 \
sudo \
tar \
tmux \
unzip \
util-linux \
uuid-runtime \
wget \
xz-utils \
# Docker Extras
iproute2 \
iputils-ping \
nano \
vim \
&& apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/*

# Install Node.js
RUN echo "**** Install Node.js ****" \
&& set -uex \
&& echo -e "X-Repolib-Name: nodesource\nURIs: https://deb.nodesource.com/node_20.x\nSigned-By: /etc/apt/keyrings/nodesource.asc\nSuites: nodistro\nComponents: main\nEnabled: yes\nArchitectures: x86_64\nTypes: deb" > /etc/apt/sources.list.d/nodesource.sources \
&& apt-get update \
&& apt-get install nodejs -y \
&& apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/* \
&& npm install -g npm@latest

# Install GameDig https://docs.linuxgsm.com/requirements/gamedig
RUN echo "**** Install GameDig ****" \
&& npm install -g [email protected]

WORKDIR /app

## Add linuxgsm user
RUN echo "**** Add linuxgsm user ****" \
&& mkdir /data \
# Create the user
&& groupadd --gid $GID $USER \
&& useradd --uid $UID --gid $GID -m $USER \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& echo $USER ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USER \
&& chmod 0440 /etc/sudoers.d/$USER \
&& chown $USER:$USER /data

HEALTHCHECK --interval=1m --timeout=1m --start-period=2m --retries=1 CMD /app/entrypoint-healthcheck.sh || exit 1

## Download linuxgsm.sh
RUN echo "**** Download linuxgsm.sh ****" \
&& set -ex \
&& curl -Lo linuxgsm.sh "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_GITHUBBRANCH}/linuxgsm.sh" \
&& chmod +x linuxgsm.sh

RUN echo "**** Get LinuxGSM Modules ****" \
&& git clone --filter=blob:none --no-checkout --sparse https://github.com/GameServerManagers/LinuxGSM.git \
&& cd LinuxGSM \
&& git sparse-checkout set --cone \
&& git sparse-checkout set lgsm/modules \
&& git checkout ${LGSM_GITHUBBRANCH} \
&& mkdir -p /app/lgsm/modules \
&& mv lgsm/modules/* /app/lgsm/modules \
&& chmod +x /app/lgsm/modules/* \
&& cd ../ \
&& rm -rf LinuxGSM \
&& chown -R $USER:$USER /app

ARG CACHEBUST=1
RUN echo "$CACHEBUST"

COPY entrypoint.sh /app/entrypoint.sh
COPY entrypoint-user.sh /app/entrypoint-user.sh
COPY entrypoint-healthcheck.sh /app/entrypoint-healthcheck.sh

RUN date > /build-time.txt

ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ LinuxGSM is a command-line tool for quick, simple deployment and management of L
## Tags

- `latest`, `ubuntu` - Latest Ubuntu LTS release
- `ubuntu-24.04` - Ubuntu 24.04 LTS 'Noble Numbat'
- `ubuntu-22.04` - Ubuntu 22.04 LTS 'Jammy Jackalope'
- `ubuntu-20.04` - Ubuntu 20.04 LTS 'Focal Fossa'

0 comments on commit 7625623

Please sign in to comment.