-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.gcc
62 lines (50 loc) · 1.61 KB
/
Dockerfile.gcc
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
## base image
FROM abeimler/simple-cppbuilder:base AS base
# default compiler versions
ARG gcc_version=10
ARG extra_libraries
ARG cc="gcc-${gcc_version}"
ARG cxx="g++-${gcc_version}"
# Install packages available from standard repos
RUN pacman-db-upgrade && \
pacman -S --noconfirm --needed \
wget curl pkg-config zip unzip tar git go && \
pacman -S --noconfirm \
binutils bison \
${extra_libraries} \
cmake make ninja && \
pacman -Scc --noconfirm
# install extra packages from AUR (gcc)
USER yay
RUN yay -Syu --noconfirm && yay -S --noconfirm \
gcc${gcc_version} && \
yay -Scc --noconfirm && \
rm -rf /home/yay/.cache/*
USER root
# set default compiler
ENV CC $cc
ENV CXX $cxx
ENV CMAKE "cmake"
ENV MAKE "make"
# install vcpkg
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git /home/project/vcpkg && \
/home/project/vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"
ENV VCPKG_TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
ENV TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
# build script settings
ENV TARGET "all"
ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR "Ninja Multi-Config"
ENV CMAKE_ARGS ""
# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh
COPY ./taskfiles/*.yml /home/taskfiles/
COPY ./taskfiles/TaskfileDefault.yml /home/taskfiles/Taskfile.yml
ENV PROJECT_DIR /home/project
WORKDIR /home/project
RUN mkdir build