To start a CentOS bash terminal from command line

docker run -it centos bash

Use case: I have an Ubuntu server and wanted totest something in Centos, to spin up a CentOS like environment with bash, docker is giving this solution. This can also be tested to develop something in centos container.

Example run

[developer@askdevops ~]$ docker run -it centos bash
Unable to find image 'centos:latest' locally
Trying to pull repository docker.io/library/centos ...
latest: Pulling from docker.io/library/centos
8ba884070f61: Pull complete
Digest: sha256:a799dd8a2ded4a83484bbae769d97655392b3f86533ceb7dd96bbac929809f3c
Status: Downloaded newer image for docker.io/centos:latest

Docker container CentOS version check:

[root@c17299ca4660 /]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

Docker container Linux Kernel version check:

[root@c17299ca4660 /]# uname -a
Linux c17299ca4660 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

To exit, enter exit or press Ctrl+D

Sep 24, 2018 by | 124 views
DevOpsRun.com is LIVE!

Articles for DevOps Geeks
MobaXterm Customization
CHMOD Explained!
Bash history powerful tips
Ubuntu bash from Windows