support for tgs4 noconfigs needed***
This commit is contained in:
+65
-42
@@ -1,62 +1,85 @@
|
||||
FROM tgstation/byond:513.1533 as base
|
||||
# base = ubuntu + full apt update
|
||||
FROM ubuntu:xenial AS base
|
||||
|
||||
FROM base as rust_g
|
||||
|
||||
RUN apt-get update \
|
||||
RUN dpkg --add-architecture i386 \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get dist-upgrade -y \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
ca-certificates
|
||||
ca-certificates
|
||||
|
||||
# byond = base + byond installed globally
|
||||
FROM base AS byond
|
||||
WORKDIR /byond
|
||||
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
unzip \
|
||||
make \
|
||||
libstdc++6:i386
|
||||
|
||||
COPY dependencies.sh .
|
||||
|
||||
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
|
||||
|
||||
# build = byond + tgstation compiled and deployed to /deploy
|
||||
FROM byond AS build
|
||||
WORKDIR /tgstation
|
||||
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
curl
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN env TG_BOOTSTRAP_NODE_LINUX=1 tools/build/build \
|
||||
&& tools/deploy.sh /deploy
|
||||
|
||||
# rust = base + rustc and i686 target
|
||||
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
|
||||
|
||||
# rust_g = base + rust_g compiled to /rust_g
|
||||
FROM rust AS rust_g
|
||||
WORKDIR /rust_g
|
||||
|
||||
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 \
|
||||
pkg-config:i386 \
|
||||
libssl-dev:i386 \
|
||||
gcc-multilib \
|
||||
git \
|
||||
&& git init \
|
||||
&& git remote add origin https://github.com/tgstation/rust-g
|
||||
|
||||
COPY dependencies.sh .
|
||||
|
||||
RUN /bin/bash -c "source dependencies.sh \
|
||||
&& git fetch --depth 1 origin \$RUST_G_VERSION" \
|
||||
RUN . ./dependencies.sh \
|
||||
&& git fetch --depth 1 origin "${RUST_G_VERSION}" \
|
||||
&& git checkout FETCH_HEAD \
|
||||
&& ~/.cargo/bin/cargo build --release
|
||||
|
||||
FROM base as dm_base
|
||||
&& env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target i686-unknown-linux-gnu
|
||||
|
||||
# final = byond + runtime deps + rust_g + build
|
||||
FROM byond
|
||||
WORKDIR /tgstation
|
||||
|
||||
FROM dm_base as build
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
libssl1.0.0:i386 \
|
||||
zlib1g:i386
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN DreamMaker -max_errors 0 tgstation.dme \
|
||||
&& tools/deploy.sh /deploy \
|
||||
&& rm /deploy/*.dll
|
||||
|
||||
FROM dm_base
|
||||
|
||||
EXPOSE 1337
|
||||
|
||||
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
|
||||
|
||||
COPY --from=rust_g /rust_g/target/release/librust_g.so /root/.byond/bin/rust_g
|
||||
COPY --from=build /deploy ./
|
||||
COPY --from=rust_g /rust_g/target/i686-unknown-linux-gnu/release/librust_g.so ./librust_g.so
|
||||
|
||||
VOLUME [ "/tgstation/config", "/tgstation/data" ]
|
||||
|
||||
ENTRYPOINT [ "DreamDaemon", "tgstation.dmb", "-port", "1337", "-trusted", "-close", "-verbose" ]
|
||||
EXPOSE 1337
|
||||
|
||||
Reference in New Issue
Block a user