This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
66 lines (53 loc) · 1.81 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
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["bash", "-c"]
RUN apt-get update && \
apt-get -y install sudo
RUN useradd -m kernelb && echo "kernelb:kernelb" | chpasswd && adduser kernelb sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER kernelb
WORKDIR /home/kernelb
RUN sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y \
curl \
build-essential \
libssl-dev \
bc \
git \
unzip \
wget \
python3 \
python-is-python3 \
cmake \
gcc \
ninja-build \
ccache \
zip \
lsb-release \
software-properties-common \
gnupg
# Setup git config
ARG GIT_NAME="KernelB"
ENV GIT_NAME=${GIT_NAME}
ARG GIT_EMAIL="20230226+kernelb@users.noreply.github.com"
ENV GIT_EMAIL=${GIT_EMAIL}
RUN git config --global user.name "${GIT_NAME}"
RUN git config --global user.email "${GIT_EMAIL}"
# Enable color output (optional)
RUN git config --global color.ui true
# Pull rebase by default or supply ARG PULL_REBASE=false
ARG PULL_REBASE=true
ENV PULL_REBASE=${PULL_REBASE}
RUN git config --global pull.rebase ${PULL_REBASE}
# Install and setup latest repo, if needed
RUN sudo curl -s https://storage.googleapis.com/git-repo-downloads/repo -o /usr/local/bin/repo \
&& sudo chmod a+x /usr/local/bin/repo \
&& repo --version
# Download and install latest clang
RUN sudo curl -s https://apt.llvm.org/llvm.sh > /tmp/llvm.sh \
&& sudo chmod a+x /tmp/llvm.sh \
&& sudo /tmp/llvm.sh \
&& export LLVM_VERSION=$(cat /tmp/llvm.sh | grep -oP 'CURRENT_LLVM_STABLE=(\K[0-9.]+)') \
&& for i in $(ls /usr/lib/llvm-$LLVM_VERSION/bin) ; do sudo ln -s /usr/lib/llvm-$LLVM_VERSION/bin/$i /usr/bin/$i ; done \
&& sudo rm /tmp/llvm.sh
RUN sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/*
CMD [ "bash", "-c" ]