Docker linux add sudoers, alias commit image

at docker cli with root user:

#apt-get install sudo

#usermod -aG sudo postgres

#su – postgres

postgres # sudo whoami

Permanent Alias

vim ~/.bashrc or vi ~/.bash_aliases or vim ~/.bashprofile

alias ll=’ls -ltr’

Activate alias by typing: source ~/.bash_aliases

su postgres -> vim ~/.bashrc -> alias ll=’ls -ltr’

zip

apt-get install zip

Commit Changes to Image

Finally, create a new image by committing the changes using the following syntax:

sudo docker commit [CONTAINER_ID] [new_image_name]

Therefore, in our example it will be:

sudo docker commit deddd39fa163 ubuntu-nmap

Where deddd39fa163 is the CONTAINER ID and ubuntu-nmap is the name of the new image.


Your newly created image should now be available on the list of local images. You can verify by checking the image list again:

sudo docker images

Leave a Reply

Your email address will not be published. Required fields are marked *