I have pulled up the centos:latest Docker image which has an initial size of around 250 MB. After adding the lines below to create a group and add a user to the group the size of the docker image is ballooning to 22.7 GB.
I am not able to figure out why size is getting increased so much. Any ideas?
Here is the complete docker file:
FROM centos:latest
# Add x_user user
ARG user=x_user
ARG group=lxs_x_user
ARG uid=11111
ARG gid=22222
# Set environment variables
ENV HOME_DIR=/home/"$user"
ENV BASHRC_PATH=/home/"$user"/.bashrc
ENV SHELL=/bin/bash
# Create group
RUN groupadd --gid "$gid" --system "$group"
# Create user and add to the group
RUN useradd -G "$group" "$user" \
--uid "$uid" \
--gid "$gid" \
--home-dir "$HOME_DIR"