Some cloud provider give us preconfigure application. I have CLI and can run command. I want to know is it container or OS(ubuntu,redhat, ...)?If it is container what is its base image?
-
Related: https://stackoverflow.com/questions/23513045/how-to-check-if-a-process-is-running-inside-docker-container – Ciro Santilli OurBigBook.com Aug 02 '23 at 06:25
2 Answers
TLDR
if you are inside a container, you will see a .dockerenv
file on the root.
(thats why i suspect google cloud shell to be one).
to determine the os you can run cat /etc/os-release
;
Edit
if it is container what is its base image?
It seems like this thing varies from cloud provider to another, so you will have to do the digging yourself every time.
I've just done mine, here are the results:
exploring google cloudshell base image:
I did
cat /etc/hostname
to get the container id, and got this:cs-6000-devshell-vm-41dc38ac-9af5-42e2-9ee5-b6f9d042decb
which may provide a clue about some source
devshell
imageso I went for a Dockerfile:
sudo find / -type f -name Dockerfile
and one of the results was:
/google/devshell/customimageskeleton/Dockerfile
which looked quite appropriate to me. so i cat /google/devshell/customimageskeleton/Dockerfile
and got
FROM gcr.io/cloudshell-images/cloudshell:latest
# Add your content here
# To trigger a rebuild of your Cloud Shell image:
# 1. Commit your changes locally: git commit -a
# 2. Push your changes upstream: git push origin master
# This triggers a rebuild of your image hosted at GCR_REPO_URL.
# You can find the Cloud Source Repository hosting this file at CSR_FILE_URL
A quick googling on the gcr.io/cloudshell-images/cloudshell:latest
led me right into the image repo in google cloud registry
As you can see there, the image size is quite huge so i couldnt pull it anywhere, but if that bothers you, you can
docker pull gcr.io/cloudshell-images/cloudshell:latest
and then
docker history --no-trunc gcr.io/cloudshell-images/cloudshell:latest
to view the base Dockerfile
.
Hope that can help somebody somehow.

- 12,086
- 7
- 60
- 83

- 5,181
- 2
- 19
- 40
-
you do well. but I do not use google cloud in kubernetes this command find / -type f -name Dockerfile does not work – yasin lachini Jun 24 '19 at 07:01
-
so where are you? its going to be a different research in each cloud provider. if you cant find any docs, try to find clues inside the container, such as the container id and any dockerfiles inside it. – Efrat Levitan Jun 24 '19 at 07:19
All containers certified by Jelastic are based on Centos OS v.7, with the exception of the image with Ubuntu VPS. In order to check the version Linux OS, you need to run commands:
For example:
for containers based on Centos OS:
$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
for containers based on Debian OS:
# 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
# lsb_release -a
No LSB modules are available.
Distributor ID:Ubuntu
Description:Ubuntu 18.04.2 LTS
Release:18.04
Codename:bionic

- 1,993
- 1
- 10
- 13
-
When I buy python. Is it container or CentOS that python is install on it? – yasin lachini Jun 24 '19 at 11:52
-
Please read once again: "All containers certified by Jelastic (incl. Python) are based on Centos OS v.7, with the exception of the image with Ubuntu VPS." – Virtuozzo Jun 25 '19 at 12:50
-
it means it is not container?or the base image of container is CentOS? – yasin lachini Jun 25 '19 at 13:36
-
-