Roman Stratiienko | 3295719 | 2022-12-15 10:12:31 +0200 | [diff] [blame] | 1 | FROM ubuntu:22.10 |
| 2 | |
| 3 | ENV DEBIAN_FRONTEND=noninteractive |
| 4 | |
| 5 | ENV PATH="/home/user/bin:${PATH}" |
| 6 | |
| 7 | # Taking into account layer structure, everything should be done within one layer. |
| 8 | RUN 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 | |
| 12 | ENV RUN_USER user |
| 13 | ENV RUN_UID 1000 |
| 14 | |
| 15 | ENV USER_HOME /home/${RUN_USER} |
| 16 | |
| 17 | RUN mkdir -pv ${USER_HOME} |
| 18 | # Create new user |
| 19 | RUN 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 | |
| 27 | RUN 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 |
| 32 | RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \ |
| 33 | /etc/sudoers |
| 34 | |
| 35 | # Pass control to a newly created user |
| 36 | USER ${RUN_USER} |
| 37 | |
| 38 | # Create project path |
| 39 | RUN mkdir -pv ${USER_HOME}/drm_hwcomposer |
| 40 | WORKDIR ${USER_HOME}/drm_hwcomposer |
| 41 | |
| 42 | RUN git config --global user.name "FIRST_NAME LAST_NAME" && git config --global user.email "MY_NAME@example.com" |
| 43 | |
| 44 | CMD [ "/bin/bash" ] |