221 views

To start an Ubuntu bash terminal from command line

docker run -it ubuntu bash

Use case: This has a very nice utility: if one wants to try something in bash on top of Ubuntu OS without installing the whole Ubuntu. (Space and time saving), you need docker installed though. Let me give you and example run:

[developer@askdevops ~]$ docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
Trying to pull repository docker.io/library/ubuntu ...
latest: Pulling from docker.io/library/ubuntu
7413c47ba209: Pull complete
0fe7e7cbb2e8: Pull complete
1d425c982345: Pull complete
344da5c95cec: Pull complete
Digest: sha256:c303f19cfe9ee92badbbbd7567bc1ca47789f79303ddcef56f77687d4744cd7a
Status: Downloaded newer image for docker.io/ubuntu:latest
root@be7375c5c725:/# 

Docker container Ubuntu version check:

root@be7375c5c725:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Docker container Linux Kernel version check:

root@be7375c5c725:/# uname -a
Linux be7375c5c725 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

Dec 9, 2018 by | 221 views
Articles for DevOps Geeks
MobaXterm Customization
CHMOD Explained!
Bash history powerful tips
Ubuntu bash from Windows
..