-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (35 loc) · 1.01 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
FROM ubuntu:20.04
ARG DUSER=youser
RUN apt-get update && apt-get install -y \
apt-transport-https \
clang-11 \
curl \
git \
gnupg \
python3 \
python3-venv \
&& \
update-alternatives \
--install /bin/clang clang $(which clang-11) 50 \
--slave /bin/clang++ clang++ $(which clang++-11)
# Install Bazel
RUN \
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg && \
mv bazel.gpg /etc/apt/trusted.gpg.d/ && \
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \
apt-get update && apt-get install -y bazel
COPY . /home/$DUSER/bootstrap_project
RUN \
useradd $DUSER && \
chown -R $DUSER:$DUSER /home/$DUSER/
USER $DUSER
# Test
RUN \
git config --global user.name "Test User" && \
git config --global user.email "[email protected]"
RUN \
# Python project
~/bootstrap_project/make_project --py ~/py_test && \
# C++ project
~/bootstrap_project/make_project --cpp ~/cpp_test && \
echo Success!