Skip to content

Commit

Permalink
use debian instead of gcc for runtime
Browse files Browse the repository at this point in the history
comment and organize it a bit
drop gcc to 12 since we are using debian 12 as well
  • Loading branch information
aronwk-aaron committed Jan 2, 2024
1 parent f7664ad commit ee9df8a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcc:13 as build
FROM gcc:12 as build

WORKDIR /app

Expand All @@ -7,30 +7,38 @@ RUN set -ex; \
apt-get install -y cmake

COPY . /app/
COPY --chmod=0500 ./build.sh /app/

RUN sed -i 's/MARIADB_CONNECTOR_COMPILE_JOBS__=.*/MARIADB_CONNECTOR_COMPILE_JOBS__=2/' /app/CMakeVariables.txt

RUN chmod +x build.sh
RUN ./build.sh

FROM gcc:13 as runtime
FROM debian:12 as runtime

WORKDIR /app

RUN --mount=type=cache,id=build-apt-cache,target=/var/cache/apt \
apt update && \
apt install -y libssl3 libcurl4 && \
rm -rf /var/lib/apt/lists/*

# Grab libraries and load them
COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/libmariadb/libmariadb/libmariadb.so.3 /usr/local/lib
RUN ldconfig

# Server bins
COPY --from=build /app/build/*Server /app/

# Necessary suplimentary files
COPY --from=build /app/build/*.ini /app/default-configs/
COPY --from=build /app/build/*.so /usr/lib/
COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/*.so /usr/lib/
COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/mariadbcpp/plugin/*.so /usr/lib/
COPY --from=build /app/build/vanity /app/default-vanity
COPY --from=build /app/build/navmeshes /app/navmeshes
COPY --from=build /app/build/migrations /app/migrations
COPY --from=build /app/build/*.dcf /app/
COPY --chmod=0500 ./entrypoint.sh /app/
RUN ldconfig

# needed as the container runs with the root user
# and therefore sudo doesn't exist
ENV USE_SUDO_AUTH=0

COPY --chmod=0500 ./entrypoint.sh /app/
ENTRYPOINT [ "/app/entrypoint.sh" ]

0 comments on commit ee9df8a

Please sign in to comment.