From a44990d58c6785267da8838e60506d63609bf1e3 Mon Sep 17 00:00:00 2001 From: Chirag Shilwant <115738422+cshilwant@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:44:59 +0530 Subject: [PATCH] ubuntu-distro: Update Dockerfile - Split installation & configuration into 2 separate RUN commands. - Add comments in Dockerfile. Signed-off-by: Chirag Shilwant --- ubuntu-distro/Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ubuntu-distro/Dockerfile b/ubuntu-distro/Dockerfile index a387445..0f1ab90 100644 --- a/ubuntu-distro/Dockerfile +++ b/ubuntu-distro/Dockerfile @@ -1,14 +1,23 @@ +# Using ubuntu:22.04 as the base image FROM amd64/ubuntu:22.04 + +# Installing packages needed for Yocto & SDK Makefile builds RUN export DEBIAN_FRONTEND=noninteractive; apt-get update && \ apt-get install -y --no-install-recommends file build-essential autoconf automake bison flex libssl-dev bc u-boot-tools swig python3 python3-pip wget device-tree-compiler python3-dev dosfstools fdisk sudo && \ pip3 install jsonschema pyelftools PyYAML Mako && \ apt-get -f -y install git diffstat texinfo gawk chrpath socat doxygen dos2unix mono-devel mono-complete curl python3-distutils repo pseudo python3-sphinx \ - g++-multilib libc6-dev-i386 jq git-lfs pigz zstd liblz4-tool cpio file zstd lz4 locales && \ - locale-gen en_US en_US.UTF-8 && \ + g++-multilib libc6-dev-i386 jq git-lfs pigz zstd liblz4-tool cpio file zstd lz4 locales \ + +# Set locale's and reconfigure to use bash as the default shell for /bin/sh. +RUN export DEBIAN_FRONTEND=noninteractive; locale-gen en_US en_US.UTF-8 && \ echo "dash dash/sh boolean false" | debconf-set-selections && \ dpkg-reconfigure dash && addgroup --gid 786 tisdk && \ + # Add user tisdk with uid & gid as 786. adduser --disabled-password --uid 786 --gid 786 --gecos "" --home /home/tisdk --shell /bin/bash tisdk && \ + # Add tisdk to sudoers & make it passwordless adduser tisdk sudo && usermod -aG sudo tisdk && echo "tisdk ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ export LC_ALL="en_US.UTF-8" && export LC_CTYPE="en_US.UTF-8" && export LC_NUMERIC="en_US.UTF-8" && \ rm -rf /var/lib/apt/lists/* + +# Set default user as tisdk USER tisdk