mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 07:40:30 -08:00
Update Dockerfile (#6268)
* Update Dockerfile Took 15 minutes Took 43 seconds Took 2 minutes Took 13 seconds Took 3 minutes Took 4 minutes Took 51 seconds * Update docker-release.yml * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Multi stage build. Took 11 minutes * Add more arguments. Took 8 minutes * Remove apt cache. Took 3 minutes * Add workdir, undo tcp socket include. Took 10 minutes * Change runtime deps. Took 8 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
1
.github/workflows/docker-release.yml
vendored
1
.github/workflows/docker-release.yml
vendored
@@ -11,6 +11,7 @@ on:
|
|||||||
- master
|
- master
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/docker-release.yml'
|
- '.github/workflows/docker-release.yml'
|
||||||
|
- 'Dockerfile'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
35
Dockerfile
35
Dockerfile
@@ -1,8 +1,9 @@
|
|||||||
FROM ubuntu:24.04
|
# -------- Build Stage --------
|
||||||
|
FROM ubuntu:24.04 AS build
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y\
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
cmake \
|
cmake \
|
||||||
file \
|
file \
|
||||||
@@ -16,20 +17,28 @@ RUN apt-get update && apt-get install -y\
|
|||||||
qt6-tools-dev \
|
qt6-tools-dev \
|
||||||
qt6-tools-dev-tools
|
qt6-tools-dev-tools
|
||||||
|
|
||||||
COPY ./CMakeLists.txt ./LICENSE ./README.md /home/servatrice/code/
|
WORKDIR /src
|
||||||
COPY ./cmake /home/servatrice/code/cmake
|
COPY . .
|
||||||
COPY ./common /home/servatrice/code/common
|
RUN mkdir build && cd build && \
|
||||||
COPY ./servatrice /home/servatrice/code/servatrice
|
cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 -DWITH_DBCONVERTER=0 && \
|
||||||
|
make -j$(nproc) && \
|
||||||
WORKDIR /home/servatrice/code
|
|
||||||
|
|
||||||
WORKDIR build
|
|
||||||
RUN cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 -DWITH_DBCONVERTER=0 &&\
|
|
||||||
make &&\
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
|
||||||
|
# -------- Runtime Stage (clean) --------
|
||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
libprotobuf32t64 \
|
||||||
|
libqt6sql6-mysql \
|
||||||
|
libqt6websockets6 \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Only copy installed binaries, not source
|
||||||
|
COPY --from=build /usr/local /usr/local
|
||||||
|
|
||||||
WORKDIR /home/servatrice
|
WORKDIR /home/servatrice
|
||||||
|
|
||||||
EXPOSE 4748
|
EXPOSE 4748
|
||||||
|
|
||||||
ENTRYPOINT [ "servatrice", "--log-to-console" ]
|
ENTRYPOINT [ "servatrice", "--log-to-console" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user