diff --git a/.dockerignore b/.dockerignore index 41a3253e7..b9ec1666a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,7 @@ -.git -bin -Build/bin -Build/projects -Libraries/TiltedHooks -Libraries/TiltedReverse -Libraries/TiltedUI +.githooks/* +.github/* +.xmake/* +Services/* +build/* +vsxmake/* +Tools/* diff --git a/Docker.base b/Docker.base index 1293466b9..6d3950d0f 100644 --- a/Docker.base +++ b/Docker.base @@ -1,22 +1,13 @@ -FROM alpine:latest +FROM ubuntu:latest -ARG make_jobs=8 -ARG premake_version=5.0.0-alpha14 -ARG protobuf_version=3.9.1 +RUN apt update && \ + apt-get install software-properties-common unzip -y && \ + add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ + apt update && \ + apt install gcc-11 g++-11 curl -y && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 -RUN apk add --no-cache --update autoconf automake build-base libtool openssl-dev linux-headers && \ - cd /tmp && \ - wget https://github.com/premake/premake-core/releases/download/v${premake_version}/premake-${premake_version}-src.zip && \ - unzip -q premake-*.zip && \ - cd premake-*/build/gmake.unix/ && \ - make config=release -j $make_jobs && \ - mv ../../bin/release/premake5 /usr/local/bin && \ - cd /tmp && \ - wget https://github.com/protocolbuffers/protobuf/releases/download/v${protobuf_version}/protobuf-cpp-${protobuf_version}.zip && \ - unzip protobuf-cpp-*.zip && \ - cd protobuf-* && \ - ./autogen.sh && \ - ./configure --disable-tests && \ - make -j $make_jobs && \ - make install && \ - rm -rf /tmp/* +RUN curl -fsSL https://xmake.io/shget.text > getxmake.sh && \ + chmod +x getxmake.sh && \ + bash ./getxmake.sh && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 \ No newline at end of file diff --git a/Docker.builder b/Docker.builder index dcca65a40..6bcc4af14 100644 --- a/Docker.builder +++ b/Docker.builder @@ -4,14 +4,18 @@ ARG make_jobs=8 WORKDIR /home/server -COPY ./Build ./Build -COPY ./Code ./Code +COPY ./modules ./modules COPY ./Libraries ./Libraries +COPY xmake.lua xmake.lua +COPY ./.git ./.git +COPY ./Code ./Code + +RUN export XMAKE_ROOTDIR="/root/.local/bin" && \ +export PATH="$XMAKE_ROOTDIR:$PATH" && \ +export XMAKE_ROOT=y && \ +xmake config -y -RUN ln -s -f /usr/local/bin/premake5 ./Build/premake5 && \ - ln -s -f /usr/local/bin/protoc ./Libraries/TiltedConnect/Build/protoc && \ - cd Build && \ - ./MakeGMakeProjects.sh && \ - cd projects && \ - make config=skyrim_x64 -j $make_jobs && \ - make config=fallout4_x64 -j $make_jobs +RUN export XMAKE_ROOTDIR="/root/.local/bin" && \ +export PATH="$XMAKE_ROOTDIR:$PATH" && \ +export XMAKE_ROOT=y && \ +xmake -y -j8 diff --git a/Dockerfile b/Dockerfile index 8a9ec6eda..9a9bd961c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,21 @@ ARG project FROM server:builder AS builder -FROM scratch AS skyrim -COPY --from=builder /home/server/Build/bin/x64/SkyrimTogetherServer /SkyrimTogetherServer +FROM ubuntu AS template +RUN apt update && \ + apt-get install software-properties-common unzip -y && \ + add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ + apt update && \ + apt install gcc-11 g++-11 libssl-dev -y && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 + + +FROM template AS skyrim +COPY --from=builder /home/server/build/linux/x64/release/SkyrimTogetherServer /SkyrimTogetherServer ENTRYPOINT ["/SkyrimTogetherServer"] -FROM scratch AS fallout4 -COPY --from=builder /home/server/Build/bin/x64/FalloutTogetherServer /FalloutTogetherServer +FROM template AS fallout4 +COPY --from=builder /home/server/build/linux/x64/release/FalloutTogetherServer /FalloutTogetherServer ENTRYPOINT ["/FalloutTogetherServer"] FROM ${project} AS final