Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Docker Build #205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -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 .
29 changes: 16 additions & 13 deletions dockercontainer/DockerFile-mangosd
Original file line number Diff line number Diff line change
@@ -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" ]
22 changes: 10 additions & 12 deletions dockercontainer/DockerFile-realmd
Original file line number Diff line number Diff line change
@@ -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" ]
Loading