Skip to content

Commit

Permalink
Merge pull request #20 from CM2Walki/dev
Browse files Browse the repository at this point in the history
Transition repo to multi-stage builds CM2Walki/steamcmd#45
  • Loading branch information
CM2Walki authored Oct 23, 2022
2 parents f878733 + dbfa279 commit aa62265
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
5 changes: 0 additions & 5 deletions bullseye-metamod/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions bullseye-sourcemod/Dockerfile

This file was deleted.

16 changes: 13 additions & 3 deletions bullseye/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###########################################################
# Dockerfile that builds a TF2 Gameserver
###########################################################
FROM cm2network/steamcmd:root
FROM cm2network/steamcmd:root AS build_stage

LABEL maintainer="walentinlamonos@gmail.com"

Expand All @@ -18,11 +18,11 @@ RUN set -x \
&& apt-get install -y --no-install-recommends --no-install-suggests \
wget=1.21-1+deb11u1 \
ca-certificates=20210119 \
lib32z1=1:1.2.11.dfsg-2+deb11u1 \
lib32z1=1:1.2.11.dfsg-2+deb11u2 \
libncurses5:i386=6.2+20201114-2 \
libbz2-1.0:i386=1.0.8-4 \
libtinfo5:i386=6.2+20201114-2 \
libcurl3-gnutls:i386=7.74.0-1.3+deb11u1 \
libcurl3-gnutls:i386=7.74.0-1.3+deb11u3 \
&& mkdir -p "${STEAMAPPDIR}" \
# Add entry script
&& wget "${DLURL}/master/etc/entry.sh" -O "${HOMEDIR}/entry.sh" \
Expand All @@ -40,6 +40,8 @@ RUN set -x \
# Clean up
&& rm -rf /var/lib/apt/lists/*

FROM build_stage AS bullseye-base

ENV SRCDS_FPSMAX=300 \
SRCDS_TICKRATE=66 \
SRCDS_PORT=27015 \
Expand Down Expand Up @@ -68,3 +70,11 @@ CMD ["bash", "entry.sh"]
EXPOSE 27015/tcp \
27015/udp \
27020/udp

FROM bullseye-base AS bullseye-metamod

ENV METAMOD_VERSION 1.11

FROM bullseye-metamod AS bullseye-sourcemod

ENV SOURCEMOD_VERSION 1.11
6 changes: 6 additions & 0 deletions bullseye/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
BUILD_PATH=$(echo ${DOCKERFILE_PATH}| sed 's#/#..#g' | sed 's#[a-zA-Z0-9]\+#/#g' | cut -c 2- )

docker build --target=bullseye-base -f $(basename ${DOCKERFILE_PATH}) -t $DOCKER_REPO:latest -t $DOCKER_REPO:base ${BUILD_PATH}.
docker build --target=bullseye-metamod -f $(basename ${DOCKERFILE_PATH}) -t $DOCKER_REPO:metamod ${BUILD_PATH}.
docker build --target=bullseye-sourcemod -f $(basename ${DOCKERFILE_PATH}) -t $DOCKER_REPO:sourcemod ${BUILD_PATH}.
2 changes: 2 additions & 0 deletions bullseye/hooks/push
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker push --all-tags ${DOCKER_REPO}

0 comments on commit aa62265

Please sign in to comment.