The following commands show how to create a user named jijo in different distros
useradd -ms /bin/bash jijo
#or
useradd --create-home --shell /bin/bash jijo
SLES doesnot have the useradd command so we have to do it the hard way 😄
echo "jijo:x:1000:1000::/home/jijo:/bin/bash" >> /etc/passwd
echo "jijo:x:1000:" >> /etc/group
mkdir -p /home/jijo
chown jijo:jijo /home/jijo
# syntax=docker/dockerfile:1.3-labs
FROM ubuntu:focal-20220105
# Set up a custom user jijo
RUN <<EOF
useradd --create-home --shell /bin/bash jijo
apt-get update
apt-get install --no-install-recommends -y git=2.25.1
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
USER jijo
WORKDIR /home/jijo
RUN whoami