<p>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?</p>

yasin lachini
<h3>TLDR</h3>
<p>if you are inside a container, you will see a <code>.dockerenv</code> file on the root.
(thats why i suspect google cloud shell to be one).</p>
<p>to determine the os you can run <code>cat /etc/os-release</code>;</p>
<h3>Edit</h3>
<blockquote>
<p>if it is container what is its base image?</p>
</blockquote>
<p>It seems like this thing varies from cloud provider to another, so you will have to do the digging yourself every time.</p>
<p>I've just done mine, here are the results:</p>
<h3>exploring google cloudshell base image:</h3>
<ul>
<li><p>I did <code>cat /etc/hostname</code> to get the container id, and got this:</p>
<pre><code>  cs-6000-devshell-vm-41dc38ac-9af5-42e2-9ee5-b6f9d042decb
</code></pre>
<p>which may provide a clue about some source <code>devshell</code> image</p>
</li>
<li><p>so I went for a Dockerfile: <code>sudo find / -type f -name Dockerfile</code></p>
</li>
</ul>
<p>and one of the results was:</p>
<pre><code>/google/devshell/customimageskeleton/Dockerfile
</code></pre>
<p>which looked quite appropriate to me. so i <code>cat /google/devshell/customimageskeleton/Dockerfile</code></p>
<p>and got</p>
<pre><code>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
</code></pre>
<p>A quick googling on the <code>gcr.io/cloudshell-images/cloudshell:latest</code> led me right into <a href="https://console.cloud.google.com/gcr/images/cloudshell-images/GLOBAL/cloudshell@sha256:988004a370d465d3ca1217639d8e81684d0bf18a15572a7a0eb19bcdefeabc38/details?tab=info" rel="nofollow noreferrer">the image repo in google cloud registry</a></p>
<p>As you can see there, the image size is quite huge so i couldnt pull it anywhere, but if that bothers you, you can</p>
<pre><code>docker pull gcr.io/cloudshell-images/cloudshell:latest
</code></pre>
<p>and then</p>
<pre><code>docker history --no-trunc gcr.io/cloudshell-images/cloudshell:latest
</code></pre>
<p>to view the base <code>Dockerfile</code>.</p>
<p>Hope that can help somebody somehow.</p>
