-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
138 lines (122 loc) · 4.1 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#*****************************************************************
#
# Copyright © 2017-2020 kohnech, lnwhome All rights reserved
#
# mpeg2ts - mpeg2ts Dockerfile
#
# This file is part of mpeg2ts (Mpeg2 Transport Stream Library).
#
# Unless you have obtained mpeg2ts under a different license,
# this version of mpeg2ts is mpeg2ts|GPL.
# Mpeg2ts|GPL is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# Mpeg2ts|GPL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mpeg2ts|GPL; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#******************************************************************/
FROM ubuntu:18.04 as base
RUN apt-get update && apt-get --yes --no-install-recommends install \
ca-certificates \
curl \
gnupg2 \
gosu \
apt-utils \
software-properties-common \
build-essential \
wget \
lcov \
sudo \
zip \
unzip \
doxygen \
graphviz \
cmake \
openssh-client \
git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
### Builder image ###
FROM base as build
# LLVM Clang
ENV CLANG_VERSION=7
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$CLANG_VERSION main" && \
apt-get update && \
apt-get install --yes --no-install-recommends clang-$CLANG_VERSION \
clang-tidy-$CLANG_VERSION \
clang-format-$CLANG_VERSION \
llvm-$CLANG_VERSION-dev \
libclang-$CLANG_VERSION-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# python support
RUN apt-get update && \
apt-get install --yes --no-install-recommends \
virtualenv \
python3-setuptools \
python3-pip \
python3-dev \
python3-virtualenv \
python3-pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
#python packages
RUN pip3 install \
flake8 \
autopep8 \
virtualenv
# Install latest cppcheck
RUN git clone https://github.com/danmar/cppcheck.git /cppcheck \
&& mkdir /cppcheck/build \
&& cd /cppcheck/build \
&& cmake .. && cmake --build . -- -j16 && make install \
&& cd / && rm -rf /cppcheck
# Install gtest/gmock
RUN git clone -q https://github.com/google/googletest.git /googletest \
&& cd googletest \
&& git checkout tags/release-1.8.1 \
&& mkdir -p /googletest/build \
&& cd /googletest/build \
&& cmake .. && make -j $(nproc) && make install \
&& cd / && rm -rf /googletest
# Install benchmark
RUN git clone -q https://github.com/google/benchmark.git /benchmark \
&& cd benchmark \
&& git checkout tags/v1.4.0 \
&& mkdir -p /benchmark/build \
&& cd /benchmark/build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) && make install \
&& cd / && rm -rf /benchmark
# Install latest iwyu
RUN git clone https://github.com/include-what-you-use/include-what-you-use.git /iwyu \
&& mkdir /iwyu/build \
&& cd /iwyu && git checkout clang_$CLANG_VERSION.0 \
&& cd /iwyu/build \
&& cmake .. && cmake --build . -- -j$(nproc) && make install \
&& cd / && rm -rf /iwyu
# Install as docker user (after entrypoint)
# Install Emscripten SDK/toolchain
ENV EMSDK_VERSION=1.39
ENV EMSDK_BUILD_VERSION=5
RUN git clone https://github.com/emscripten-core/emsdk.git /tmp/emsdk && \
cd /tmp/emsdk && \
./emsdk install $EMSDK_VERSION.$EMSDK_BUILD_VERSION && \
./emsdk activate $EMSDK_VERSION.$EMSDK_BUILD_VERSION
ENV PATH="${PATH}:/tmp/emsdk:/tmp/emsdk/upstream/emscripten:/tmp/emsdk/node/12.9.1_64bit/bin"
RUN echo "PATH: " $PATH
RUN em++ --version
# entrypoint
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# WORKDIR /tmp/workspace
RUN adduser docker