Skip to content

Commit

Permalink
Rebase to Ubuntu 22
Browse files Browse the repository at this point in the history
* docker: bump base image to ubuntu 22.04

Ubuntu 18.04 (Bionic) is unmaintained and marked as EOL since May 2023.
The issue with the `ubuntu` (PID 1000) user was introduced in Ubuntu
24.04 (Noble).

* healthcheck: use jq to parse json

The use of `grep` requires the HTTP server to return the JSON body
in one line. This could change with an update (either intended or not)
and would break the healthcheck.

Instead, we should parse the JSON and exit with code 1 if the health
is not healthy.

---------

Signed-off-by: Tan Siewert <[email protected]>
  • Loading branch information
sinuscosinustan authored Sep 12, 2024
1 parent 230fa9a commit 99a972a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM steamcmd/steamcmd:ubuntu-18
FROM steamcmd/steamcmd:ubuntu-22

# hadolint ignore=DL3008
RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y gosu xdg-user-dirs curl --no-install-recommends\
&& DEBIAN_FRONTEND=noninteractive apt-get install -y gosu xdg-user-dirs curl jq --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -ms /bin/bash steam \
&& gosu nobody true
Expand Down
2 changes: 1 addition & 1 deletion healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
curl -k -f -X POST "https://127.0.0.1:${SERVERGAMEPORT}/api/v1" \
-H "Content-Type: application/json" \
-d '{"function":"HealthCheck","data":{"clientCustomData":""}}' \
| grep -q '{"data":{"health":"healthy"'
| jq -e '.data.health == "healthy"'

0 comments on commit 99a972a

Please sign in to comment.