From f7b400a08a4df6ccc152b34b1355e5ad6149a8a2 Mon Sep 17 00:00:00 2001 From: reesericci Date: Wed, 29 Nov 2023 17:13:14 +0100 Subject: [PATCH 1/4] docker support (Rebased patch by topjor) --- README.md | 12 ++++++++++++ docker/Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 docker/Dockerfile diff --git a/README.md b/README.md index 014c2cc4..989099ec 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,18 @@ that the server should block from being allowed to be used. If a line has an IP followed by a comma and the word public (`1.2.3.4,public` for example), then it will allow the IP to be used for private groups, but not present any of the public groups to that user. +# USAGE WITH DOCKER + +A docker image is available to use. + +How to use: + + git clone https://github.com/essej/aooserver.git + cd aooserver/docker + docker build . -t aooserver + docker run -d -p 10998:10998/udp -p 10998:10998 --name aooserver aooserver + +How to run with flags: `docker run -d -p PORT:PORT/udp -p PORT:PORT --name aooserver aooserver aooserver [flags]` # SOURCE NOTES diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..b55f97ef --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,23 @@ +FROM debian:buster +RUN apt-get update +RUN apt-get install -y git make bash g++ curl libcurl4-openssl-dev pkg-config + +RUN mkdir /app + +WORKDIR /app + +RUN git clone --recursive https://github.com/essej/aooserver.git +WORKDIR /app/aooserver + +EXPOSE 10998/udp +EXPOSE 10998/tcp + +WORKDIR Builds/LinuxMakefile +RUN bash -c "CONFIG=Release make" + +RUN mkdir /app/bin && cp /app/aooserver/Builds/LinuxMakefile/build/aooserver /app/bin/aooserver + +ENV PATH="/app/bin:${PATH}" +RUN echo "export PATH=$PATH" > /etc/environment + +CMD aooserver From e7651cbee77fb3f7d3cc41cad759aa94c9a55819 Mon Sep 17 00:00:00 2001 From: Jordie Limpens Date: Wed, 29 Nov 2023 17:18:35 +0100 Subject: [PATCH 2/4] Updated base container and split build process --- docker/Dockerfile | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b55f97ef..70d97885 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,23 +1,25 @@ -FROM debian:buster -RUN apt-get update -RUN apt-get install -y git make bash g++ curl libcurl4-openssl-dev pkg-config - -RUN mkdir /app +## Building is done in a separate container +FROM debian:12 as builder +## Install dependencies +RUN apt-get update && apt-get install -y git make bash g++ curl libcurl4-openssl-dev pkg-config +## Clone the repository to build the source WORKDIR /app - RUN git clone --recursive https://github.com/essej/aooserver.git -WORKDIR /app/aooserver - -EXPOSE 10998/udp -EXPOSE 10998/tcp -WORKDIR Builds/LinuxMakefile +## Build the release +WORKDIR /app/aooserverBuilds/LinuxMakefile RUN bash -c "CONFIG=Release make" -RUN mkdir /app/bin && cp /app/aooserver/Builds/LinuxMakefile/build/aooserver /app/bin/aooserver - -ENV PATH="/app/bin:${PATH}" -RUN echo "export PATH=$PATH" > /etc/environment +## Actual end container containing our service +FROM debian:12-slim +## Install dependencies +RUN apt-get update && apt-get install -y curl +## Copy our build from the build container +COPY --from=builder /app/aooserver/Builds/LinuxMakefile/build/aooserver /usr/bin/aooserver +## Add port exposure +EXPOSE 10998/udp +EXPOSE 10998/tcp +## Default command CMD aooserver From 2bbd50f26d7694f265408eb47d086b96381fd67c Mon Sep 17 00:00:00 2001 From: Jordie Limpens Date: Wed, 29 Nov 2023 17:23:05 +0100 Subject: [PATCH 3/4] Expanded the docker section in the readme --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 989099ec..08d6687e 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,19 @@ the IP to be used for private groups, but not present any of the public groups t # USAGE WITH DOCKER -A docker image is available to use. +A Dockerfile is available for building the docker container image. -How to use: +Building the container image: git clone https://github.com/essej/aooserver.git cd aooserver/docker docker build . -t aooserver - docker run -d -p 10998:10998/udp -p 10998:10998 --name aooserver aooserver -How to run with flags: `docker run -d -p PORT:PORT/udp -p PORT:PORT --name aooserver aooserver aooserver [flags]` +Using the container image: + + docker run -p 10998:10998/udp -p 10998:10998 aooserver + +How to run with flags: `docker run -p PORT:PORT/udp -p PORT:PORT aooserver aooserver [flags]` # SOURCE NOTES From d8680fde05a19ae97a7416275e3cc40e3cab818d Mon Sep 17 00:00:00 2001 From: Jordie Limpens Date: Sat, 2 Dec 2023 16:01:36 +0100 Subject: [PATCH 4/4] Fixed directory separator missing after directory change merging --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 70d97885..43304311 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /app RUN git clone --recursive https://github.com/essej/aooserver.git ## Build the release -WORKDIR /app/aooserverBuilds/LinuxMakefile +WORKDIR /app/aooserver/Builds/LinuxMakefile RUN bash -c "CONFIG=Release make"