blob: d0ecee2ef7db2a5e1eb7192992e700951aa37657 [file] [log] [blame]
Roman Stratiienko32957192022-12-15 10:12:31 +02001FROM ubuntu:22.10
2
3ENV DEBIAN_FRONTEND=noninteractive
4
5ENV PATH="/home/user/bin:${PATH}"
6
7# Taking into account layer structure, everything should be done within one layer.
8RUN apt-get update && apt-get upgrade -y && \
9 apt-get install -y clang-15 clang-tidy-15 clang-format-15 git libdrm-dev blueprint-tools libgtest-dev clang llvm make python3 python3-pip wget sudo && \
10 pip3 install mako meson jinja2 ply pyyaml
11
12ENV RUN_USER user
13ENV RUN_UID 1000
14
15ENV USER_HOME /home/${RUN_USER}
16
17RUN mkdir -pv ${USER_HOME}
18# Create new user
19RUN adduser \
20 --gecos 'Build User' \
21 --shell '/usr/bin/bash' \
22 --uid ${RUN_UID} \
23 --disabled-login \
24 --disabled-password ${RUN_USER} \
25 && adduser ${RUN_USER} sudo
26
27RUN chown -R ${RUN_USER}:${RUN_USER} ${USER_HOME} && chmod -R 775 ${USER_HOME}
28
29# Ensure sudo group users are not
30# asked for a password when using
31# sudo command by ammending sudoers file
32RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \
33/etc/sudoers
34
35# Pass control to a newly created user
36USER ${RUN_USER}
37
38# Create project path
39RUN mkdir -pv ${USER_HOME}/drm_hwcomposer
40WORKDIR ${USER_HOME}/drm_hwcomposer
41
42RUN git config --global user.name "FIRST_NAME LAST_NAME" && git config --global user.email "MY_NAME@example.com"
43
44CMD [ "/bin/bash" ]