Skip to content

Commit

Permalink
[MIRROR] docker file and version update (CHOMPStation2#9710)
Browse files Browse the repository at this point in the history
Co-authored-by: Kashargul <[email protected]>
  • Loading branch information
CHOMPStation2StaffMirrorBot and Kashargul authored Dec 28, 2024
1 parent f3e348b commit 3f6c0f4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .tgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: 1
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
# Must be interpreted as a string, keep quoted
byond: "515.1637"
byond: "515.1647"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static
Expand Down
114 changes: 57 additions & 57 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
FROM i386/ubuntu:xenial as base

ARG BYOND_MAJOR=515
ARG BYOND_MINOR=1640

RUN apt-get update \
&& apt-get install -y \
curl \
unzip \
make \
libstdc++6 \
&& curl "https://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip \
&& unzip byond.zip \
&& cd byond \
&& sed -i 's|install:|&\n\tmkdir -p $(MAN_DIR)/man6|' Makefile \
&& make install \
&& chmod 644 /usr/local/byond/man/man6/* \
&& apt-get purge -y --auto-remove curl unzip make \
&& cd .. \
&& rm -rf byond byond.zip /var/lib/apt/lists/*

FROM base as rust_g

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates
FROM ubuntu:22.04 AS base

WORKDIR /rust_g
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
ca-certificates

FROM base AS byond
WORKDIR /byond

RUN apt-get install -y --no-install-recommends \
libssl-dev \
pkg-config \
curl \
gcc-multilib \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y --default-host i686-unknown-linux-gnu \
&& git init \
&& git remote add origin https://github.com/tgstation/rust-g
curl \
unzip \
make \
libstdc++6:i386

COPY dependencies.sh .

RUN /bin/bash -c "source dependencies.sh \
&& git fetch --depth 1 origin \$RUST_G_VERSION" \
&& git checkout FETCH_HEAD \
&& ~/.cargo/bin/cargo build --release
RUN . ./dependencies.sh \
&& curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip \
&& unzip byond.zip \
&& cd byond \
&& sed -i 's|install:|&\n\tmkdir -p $(MAN_DIR)/man6|' Makefile \
&& make install \
&& chmod 644 /usr/local/byond/man/man6/* \
&& apt-get purge -y --auto-remove curl unzip make \
&& cd .. \
&& rm -rf byond byond.zip

FROM base as dm_base
FROM byond AS build

WORKDIR /vorestation

FROM dm_base as build
RUN apt-get install -y --no-install-recommends \
curl

COPY . .

RUN DreamMaker -max_errors 0 vorestation.dme
RUN env TG_BOOTSTRAP_NODE_LINUX=1 tools/build/build

FROM dm_base
FROM base AS rust
RUN apt-get install -y --no-install-recommends \
curl && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal \
&& ~/.cargo/bin/rustup target add i686-unknown-linux-gnu

EXPOSE 2303
FROM rust AS rust_g
WORKDIR /rust_g

RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
libmariadb2 \
mariadb-client \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /root/.byond/bin
RUN apt-get install -y --no-install-recommends \
libssl3 \
gcc-multilib \
git \
&& git init \
&& git remote add origin https://github.com/tgstation/rust-g

COPY dependencies.sh .

RUN . ./dependencies.sh \
&& git fetch --depth 1 origin "${RUST_G_VERSION}" \
&& git checkout FETCH_HEAD \
&& env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target i686-unknown-linux-gnu --features all

FROM byond
WORKDIR /vorestation

RUN apt-get install -y --no-install-recommends \
libssl3 \
zlib1g:i386

COPY --from=build /vorestation/ ./
COPY --from=rust_g /rust_g/target/release/librust_g.so ./librust_g.so
COPY --from=rust_g /rust_g/target/i686-unknown-linux-gnu/release/librust_g.so ./librust_g.so

#VOLUME [ "/vorestation/config", "/vorestation/data" ]

ENTRYPOINT [ "DreamDaemon", "vorestation.dmb", "-port", "2303", "-trusted", "-close", "-verbose" ]
EXPOSE 2303
27 changes: 0 additions & 27 deletions _build_dependencies.sh

This file was deleted.

6 changes: 4 additions & 2 deletions dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

# byond version
export BYOND_MAJOR=515
export BYOND_MINOR=1637
export BYOND_MINOR=1647

# Macro Count
export MACRO_COUNT=8

#rust_g git tag
export RUST_G_VERSION=3.4.0
export RUST_G_VERSION=3.5.1

#node version
export NODE_VERSION_LTS=20.13.0
Expand Down

0 comments on commit 3f6c0f4

Please sign in to comment.