1FROM  --platform=linux/amd64 ubuntu:22.04
2
3SHELL ["/bin/bash", "-c"]
4
5ARG USERNAME=user
6ARG USER_UID=1000
7ARG USER_GID=$USER_UID
8
9ARG DEBIAN_FRONTEND=noninteractive
10
11RUN apt-get update && \
12    apt-get -y install \
13        build-essential \
14        curl \
15        gdb \
16        gh \
17        git \
18        less \
19        libncurses5 \
20        libtinfo5 \
21        llvm-15-tools \
22        locales \
23        nano \
24        python3 \
25        python3-pip \
26        python-is-python3 \
27        software-properties-common \
28        sudo \
29        unzip && \
30    ln -s /usr/bin/FileCheck-15 /usr/bin/FileCheck
31
32RUN add-apt-repository ppa:deadsnakes/ppa && \
33    apt-get -y install libpython3.9
34
35RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
36    locale-gen
37
38RUN pip install \
39        lit \
40        python-matrix-runner
41
42# Create the user
43RUN groupadd --gid $USER_GID $USERNAME \
44    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
45    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
46    && chmod 0440 /etc/sudoers.d/$USERNAME
47
48RUN mkdir -p /workspaces && \
49    chown $USER_UID:$USER_GID /workspaces
50
51ADD vcpkg-configuration.json /home/
52ADD postCreateCommand.sh /home/
53
54RUN chmod +x /home/postCreateCommand.sh
55
56USER $USERNAME
57WORKDIR /home/$USERNAME
58
59CMD ["/bin/bash"]
60