diff --git a/DOCKER.md b/DOCKER.md new file mode 100644 index 0000000..655cdec --- /dev/null +++ b/DOCKER.md @@ -0,0 +1,15 @@ +# Building + + docker build -t henryfbp/arrcon:latest ./ + +# Running + + docker run -it henryfbp/arrcon:latest ARRCON --help + +# Pushing/publishing (author only) + + docker push henryfbp/arrcon:latest + +# Pulling + + docker pull henryfbp/arrcon:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c28af30 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# ---- Build Stage ---- +FROM ubuntu:latest AS build + +RUN apt-get update && \ + apt-get install -y gcc-10 g++-10 cmake ninja-build git && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +ADD CMakeLists.txt CMakePresets.json /app/ +ADD 307lib /app/307lib +ADD ARRCON /app/ARRCON + +ENV CC=gcc-10 +ENV CXX=g++-10 + +RUN cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja && \ + cmake --build build --config Release + +# ---- Runtime Stage ---- +FROM ubuntu:latest + +# Only copy the built binary from the build stage +COPY --from=build /app/build/ARRCON/ARRCON /usr/local/bin/arrcon + +# (Optional) Install runtime dependencies if needed +# RUN apt-get update && apt-get install -y && rm -rf /var/lib/apt/lists/* + +ENTRYPOINT ["/usr/local/bin/arrcon"] +CMD ["--help"] \ No newline at end of file