diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml new file mode 100644 index 000000000..d505640c3 --- /dev/null +++ b/.github/workflows/docker_build.yml @@ -0,0 +1,31 @@ +name: Docker Build +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout Submodules + shell: bash + run: | + git submodule init && git submodule update + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Mangosd Docker image + run: | + docker build -t mangosd:latest -f dockercontainer/DockerFile-mangosd . + + - name: Build Realmd Docker image + run: | + docker build -t realmd:latest -f dockercontainer/DockerFile-realmd . \ No newline at end of file diff --git a/dockercontainer/DockerFile-mangosd b/dockercontainer/DockerFile-mangosd index 983b808a7..e063b259d 100644 --- a/dockercontainer/DockerFile-mangosd +++ b/dockercontainer/DockerFile-mangosd @@ -1,33 +1,36 @@ #Build image -FROM ubuntu:18.04 as build-step +FROM ubuntu:22.04 AS build-step -RUN apt-get -y update -RUN apt-get -y install curl autoconf automake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool build-essential gpg wget lsb-release software-properties-common +ENV TZ=US DEBIAN_FRONTEND=noninteractive -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ - apt-get update -RUN apt-get -y install cmake +RUN apt-get -y update +RUN apt-get -y install curl autoconf automake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool \ + build-essential lsb-release software-properties-common cmake libreadline-dev clang COPY . /mangoserver -RUN mkdir /mangoserver/build +RUN mkdir /mangoserver/build && cd /mangoserver/build WORKDIR /mangoserver/build #Install mangos -RUN cmake .. -DCMAKE_INSTALL_PREFIX=/mangos -DBUILD_MANGOSD=1 -DBUILD_REALMD=0 -DBUILD_TOOLS=0 +RUN cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/mangos -DBUILD_MANGOSD=1 -DBUILD_REALMD=0 -DBUILD_TOOLS=0 RUN make -j4 RUN make install #Runtime image -FROM ubuntu:18.04 as runtime +FROM ubuntu:22.04 AS runtime + +ENV TZ=US DEBIAN_FRONTEND=noninteractive RUN apt-get -y update && apt-get -y upgrade -RUN apt-get -y install libmysqlclient20 openssl +RUN apt-get -y install libmysqlclient-dev openssl lua-readline COPY --from=build-step /mangos /mangos -COPY --from=build-step /etc/mangosd.conf.dist ../etc/mangosd.conf.dist +COPY --from=build-step /etc/mangosd.conf.dist /mangos/etc/mangosd.conf.dist + +RUN echo "/mangos/lib" >> /etc/ld.so.conf && ldconfig + WORKDIR /mangos/bin RUN chmod +x mangosd EXPOSE 8085 -ENTRYPOINT [ "./mangosd" ] +ENTRYPOINT [ "./mangosd","-c","/mangos/etc/mangosd.conf" ] diff --git a/dockercontainer/DockerFile-realmd b/dockercontainer/DockerFile-realmd index b7074116f..400297592 100644 --- a/dockercontainer/DockerFile-realmd +++ b/dockercontainer/DockerFile-realmd @@ -1,33 +1,31 @@ #Build image -FROM ubuntu:18.04 as build-step +FROM ubuntu:22.04 AS build-step + +ENV TZ=US DEBIAN_FRONTEND=noninteractive RUN apt-get -y update -RUN apt-get -y install curl autoconf automake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool build-essential gpg wget +RUN apt-get -y install curl autoconf automake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool \ + build-essential lsb-release software-properties-common cmake libreadline-dev clang -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ - apt-get update -RUN apt-get -y install cmake - COPY . /mangoserver RUN mkdir /mangoserver/build WORKDIR /mangoserver/build #Install mangos -RUN cmake .. -DCMAKE_INSTALL_PREFIX=/mangos -DBUILD_MANGOSD=0 -DBUILD_REALMD=1 -DBUILD_TOOLS=0 +RUN cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/mangos -DBUILD_MANGOSD=0 -DBUILD_REALMD=1 -DBUILD_TOOLS=0 RUN make -j4 RUN make install #Runtime image -FROM ubuntu:18.04 as runtime +FROM ubuntu:22.04 AS runtime RUN apt-get -y update && apt-get -y upgrade -RUN apt-get -y install libmysqlclient20 openssl +RUN apt-get -y install libmysqlclient-dev openssl COPY --from=build-step /mangos /mangos -COPY --from=build-step /etc/realmd.conf.dist ../etc/realmd.conf.dist +COPY --from=build-step /etc/realmd.conf.dist /mangos/etc/realmd.conf.dist WORKDIR /mangos/bin RUN chmod +x realmd EXPOSE 3724 -ENTRYPOINT [ "./realmd" ] +ENTRYPOINT [ "./realmd","-c","/mangos/etc/realmd.conf" ]