1FROM ubuntu:23.04 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 \ 10 llvm make python3 wget sudo rsync lld pkg-config ninja-build meson \ 11 python3-mako python3-jinja2 python3-ply python3-yaml 12 13ENV RUN_USER user 14ENV RUN_UID 1000 15 16ENV USER_HOME /home/${RUN_USER} 17 18RUN mkdir -pv ${USER_HOME} 19 20# Delete default user 21RUN userdel -r ubuntu 22 23# Create new user 24RUN adduser \ 25 --gecos 'Build User' \ 26 --shell '/usr/bin/bash' \ 27 --uid ${RUN_UID} \ 28 --disabled-login \ 29 --disabled-password ${RUN_USER} \ 30 && adduser ${RUN_USER} sudo 31 32RUN chown -R ${RUN_USER}:${RUN_USER} ${USER_HOME} && chmod -R 775 ${USER_HOME} 33 34# Ensure sudo group users are not 35# asked for a password when using 36# sudo command by ammending sudoers file 37RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \ 38/etc/sudoers 39 40# Pass control to a newly created user 41USER ${RUN_USER} 42 43# Install aospless package (produced by GloDroid/aospext) 44RUN wget -P ${USER_HOME} https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/uploads/28ef9379b1a0ec1ee19a17825b0f3f3f/aospless_drm_hwcomposer_arm64.tar.xz && \ 45 cd ${USER_HOME} && \ 46 (echo 96b2148d04c50cf36d4151ae022e665764b8ca3317712e9467a433b62c545a43 aospless_drm_hwcomposer_arm64.tar.xz | sha256sum --check) && \ 47 tar xf aospless_drm_hwcomposer_arm64.tar.xz && \ 48 rm -r ${USER_HOME}/aospless/src && ln -s ../drm_hwcomposer/ ${USER_HOME}/aospless/src 49 50# Create project path 51RUN mkdir -pv ${USER_HOME}/drm_hwcomposer 52WORKDIR ${USER_HOME}/drm_hwcomposer 53 54RUN git config --global user.name "FIRST_NAME LAST_NAME" && git config --global user.email "MY_NAME@example.com" 55 56CMD [ "/bin/bash" ] 57