Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Apr 6, 2024
1 parent 5882c77 commit e8ba7a7
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 14 deletions.
46 changes: 46 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build HLDS Image",
"type": "docker-build",
"dockerBuild": {
"context": "${workspaceFolder}",
"buildArgs": {
"MOD": "${input:mod}"
},
"tag": "rehlds_image:${input:mod}"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "Run HLDS container",
"command": "docker run --rm -ti -p 26900-27020:26900-27020/udp rehlds_image:${input:mod}",
"dependsOn": [
"Build HLDS Image"
]
}
],
"inputs": [
{
"type": "pickString",
"id": "mod",
"default": "valve",
"description": "Select mod.",
"options": [
"valve",
"cstrike",
"czero",
"dod",
"gearbox",
"tfc",
"ricochet",
"dmc"
]
}
]
}
35 changes: 21 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
ARG APPDIR="/root/hlds"
# syntax=docker/dockerfile:1

FROM debian:bookworm-slim AS build_stage
ARG APPDIR
ARG MOD="valve"
ARG TAG="steam_legacy"

FROM debian:trixie-slim AS build_stage

LABEL creator="Sergey Shorokhov <[email protected]>"

# Install required packages
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates curl libarchive-tools \
ca-certificates=20240203 \
curl=8.5.0-2 \
libarchive-tools=3.7.2-1 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /root/
COPY --chmod=755 utils/* utils/
WORKDIR /usr/local/bin/

ADD --chmod=755 https://raw.githubusercontent.com/hldsdocker/rehlds/master/utils/GetGithubReleaseUrl.sh GetGithubReleaseUrl

WORKDIR /root/hlds

# Install ReHLDS
RUN releaseLink=$(utils/GetGithubReleaseUrl.sh "dreamstalker/rehlds" "latest") \
&& mkdir -p $APPDIR \
&& curl -L# $releaseLink | bsdtar -xf - --strip-components=2 --directory $APPDIR bin/linux32/* \
&& chmod +x $APPDIR/hlds_linux $APPDIR/hltv \
&& rm -rf utils
RUN releaseLink=$(GetGithubReleaseUrl "dreamstalker/rehlds" "latest") \
&& curl -sSL $releaseLink | bsdtar -xf - --strip-components=2 bin/linux32/* \
&& chmod +x hlds_linux hltv

# Install ReGameDLL_CS
RUN releaseLink=$(GetGithubReleaseUrl "s1lentq/ReGameDLL_CS" "latest") \
&& curl -sSL $releaseLink | bsdtar -xf - --strip-components=2 bin/linux32/*

FROM wopox1337/hlds:steam_legacy AS run_stage
ARG APPDIR
FROM hldsdocker/${MOD}:${TAG} AS run_stage

COPY --chmod=755 --from=build_stage ${APPDIR} ${APPDIR}
COPY --chown=${APPUSER}:${APPUSER} --chmod=755 --from=build_stage /root/hlds .

0 comments on commit e8ba7a7

Please sign in to comment.