[Docker] – How to run docker images?

Following the command to run docker images locally.

docker run -it –rm <image:tag> <command>

NOTE: The “–rm” will remove the image after you exit from it.

So, if for example, you would like to be in the bash of some image after it is initialized then you will replace the command for “bash”. Following an example.

docker run -it –rm registry.access.redhat.com/ubi8/ubi:latest bash

bash-4.4# ls

bin  boot  dev etc  home  lib lib64  lost+found  media  mnt  opt  proc  root run  sbin  srv sys  tmp  usr  var


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s