-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (41 loc) · 2.04 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
ARG UBUNTU_VERSION=20.04
ARG LLVM_VERSION=12
FROM ubuntu:$UBUNTU_VERSION
ARG LLVM_VERSION
ARG UBUNTU_VERSION
ARG USERNAME=vscode
ARG USER_UID=1001
ARG USER_GID=$USER_UID
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -q update \
&& apt-get install -y --no-install-recommends ca-certificates software-properties-common curl gnupg2 \
&& curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - \
&& apt-add-repository -y "deb http://apt.llvm.org/`lsb_release -cs`/ llvm-toolchain-`lsb_release -cs`-$LLVM_VERSION main" \
&& apt-get -q update \
&& apt-get install -y --no-install-recommends sudo git ssh zlib1g-dev libzstd-dev automake autoconf cmake make lldb ninja-build gcc g++ gfortran build-essential libtool llvm-$LLVM_VERSION-dev clang-format clangd clang-$LLVM_VERSION libclang-$LLVM_VERSION-dev libomp-$LLVM_VERSION-dev libblas-dev libeigen3-dev libboost-dev python3 python3-pip \
&& groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& apt-get autoremove -y --purge \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
RUN if [ "$UBUNTU_VERSION" = "24.04" ] ; then \
python3 -m pip install --break-system-packages lit pathlib2; \
else \
python3 -m pip install lit pathlib2; \
fi
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
&& mkdir /commandhistory \
&& touch /commandhistory/.bash_history \
&& chown -R $USERNAME /commandhistory \
&& echo $SNIPPET >> "/home/$USERNAME/.bashrc"
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \
/home/$USERNAME/.vscode-server-insiders/extensions \
&& chown -R $USERNAME \
/home/$USERNAME/.vscode-server \
/home/$USERNAME/.vscode-server-insiders
RUN mkdir -p /workspaces/Enzyme/build \
&& chown -R $USERNAME /workspaces/Enzyme/build
ENV DEBIAN_FRONTEND=
USER $USERNAME