-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
49 lines (45 loc) · 2.15 KB
/
Dockerfile
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
# syntax=docker/dockerfile:1.3
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.217.4/containers/cpp/.devcontainer/base.Dockerfile
# [Choice] Debian / Ubuntu version (use Debian 11, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-11, debian-10, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="bullseye"
#
# Basic dev tools and Drogon dependencies
#
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} AS base
# Add backports to apt for latest cmake
RUN echo "deb http://deb.debian.org/debian bullseye-backports main contrib non-free" >> /etc/apt/sources.list
# Install essential dev tools and drogon dependencies
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y install \
build-essential cppcheck valgrind gdb \
libjsoncpp-dev \
uuid-dev \
openssl \
libssl-dev \
zlib1g-dev \
&& apt-get -y -t bullseye-backports install cmake
#
# Clang 11
#
FROM base AS clang11
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y install clang lldb llvm
# Build the repository
RUN --mount=type=bind,target=/code,source=. cmake -S /code -B /build && cmake --build /build
WORKDIR /code
#
# Clang 13
#
FROM base AS clang13
COPY .llvm-snapshot.gpg.key /etc/.llvm-snapshot.gpg.key
RUN apt-key add /etc/.llvm-snapshot.gpg.key
RUN echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list
RUN echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y install clang-13 llvm-13 lldb-13
# Build the repository
RUN --mount=type=bind,target=/code,source=. cmake -S /code -B /build && cmake --build /build
WORKDIR /code