forked from Kuyoh/docker-vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.debian
46 lines (33 loc) · 1.29 KB
/
Dockerfile.debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ARG BASE_IMAGE=ubuntu:22.04
# based on debian
FROM ${BASE_IMAGE} AS vcpkg
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends tzdata && \
apt-get install -y --no-install-recommends zip unzip curl tar build-essential pkg-config git ca-certificates \
yasm nasm autoconf automake autotools-dev libtool && \
rm -Rf /var/lib/apt/lists/*
# Set environment variables
ENV VCPKG_ROOT=/opt/vcpkg
ENV CMAKE_ROOT=/opt/cmake
ENV NINJA_ROOT=/opt/ninja
ENV PATH=${NINJA_ROOT}:${CMAKE_ROOT}/bin:${VCPKG_ROOT}:${PATH}
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
COPY version_vcpkg.env install_vcpkg.sh /opt/
# Download, build and install tools
RUN cd /opt && \
chmod a+x install_vcpkg.sh && \
./install_vcpkg.sh ${VCPKG_ROOT} ${NINJA_ROOT} ${CMAKE_ROOT} && \
rm install_vcpkg.sh && rm version_vcpkg.env
FROM vcpkg as testing
WORKDIR /workspace
# copy test code
COPY testproject ./
# generate tests
RUN cmake -DCMAKE_TOOLCHAIN_FILE:STRING=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug \
-H/workspace -B/workspace/build -G Ninja
# build & run tests
RUN cmake --build /workspace/build --config Debug --target all -j 6 -- && \
cd /workspace/build && ctest
FROM vcpkg as final