Build a docker image with Dockerfile
$ cat Dockerfile
FROM ubuntu:20.04
MAINTAINER JACK<jack@cool-pi.com>
#RUN sed -i s@/ports.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
&& apt-get clean
RUN apt-get update
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y build-essential chrpath vim expect git curl dialog tzdata locales iputils-ping net-tools
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN locale-gen en_US.UTF-8 && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN locale-gen en_US
RUN useradd coolpi;\
adduser coolpi sudo;\
mkdir -p /home/coolpi;\
chown coolpi:coolpi -R /home/coolpi;\
echo coolpi:coolpi | chpasswd;
#CMD su -l coolpi
#CMD "/bin/bash"
$ docker build -t my-ubuntu:20.04 --rm=true .
...