tictactoebotdocker/Dockerfile

55 lines
1.4 KiB
Docker

FROM debian:bullseye-slim as builder
WORKDIR /app
RUN printf "%s\n" "deb http://deb.debian.org/debian bullseye main" \
"deb http://deb.debian.org/debian-security/ bullseye-security main" \
"deb http://deb.debian.org/debian bullseye-updates main" \
"deb http://deb.debian.org/debian bullseye-backports main" \
>/etc/apt/sources.list
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
make \
# nlohmann-json3-dev=3.7.3-1 \
libcurl4-openssl-dev \
g++ \
git \
ca-certificates \
&& apt-get -qq -y autoremove --purge \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/*
COPY tictactoebot/ .
# install json lib
RUN git clone --progress --verbose --branch "v3.7.3" --depth 1 https://github.com/nlohmann/json.git
RUN ln -s /app/json/include/nlohmann TAPI/include/
RUN make -j
FROM debian:bullseye-slim
WORKDIR /app
RUN printf "%s\n" "deb http://deb.debian.org/debian bullseye main" \
"deb http://deb.debian.org/debian-security/ bullseye-security main" \
"deb http://deb.debian.org/debian bullseye-updates main" \
"deb http://deb.debian.org/debian bullseye-backports main" \
>/etc/apt/sources.list
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
libcurl4 \
ca-certificates \
&& apt-get -qq -y autoremove --purge \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/tictactoebot ./
COPY entry.sh ./
ENTRYPOINT ["/app/entry.sh"]
CMD []