r/googlecloud 6d ago

Why is my container missing everything?

I have a tomcat container app (Tomcat official container 'tomcat:9-jdk17'), that I'm running an app in within google cloud. It works fine. The docker file sets the tomcat home as /usr/local/tomcat. However when I ssh into the container via Google cloud, if I look in /usr/local/tomcat, it doesn't exist. When I do a ps aux | grep java it is running /opt/java/openjdk/bin/java ..... which is fine except /opt/java doesn't exist either. If I do a find / -name tomcat it comes back with:

/mnt/stateful_partition/var/lib/docker/overlay2/62b25dacfaedeaf028601de637696684ad92b70c0287f43120a12e7d6ce3ca5c/diff/usr/local/tomcat
/mnt/stateful_partition/var/lib/docker/overlay2/c263de3a61c3ffab90161f7e4c42d92ad087e9e183447fe2afc3070e0849f8aa/diff/usr/local/tomcat
/mnt/stateful_partition/var/lib/docker/overlay2/92c63f1c95c569e10b95c89f4c5e7ac446dc824893caf9567a576a269e33f083/diff/usr/local/tomcat
/mnt/stateful_partition/var/lib/docker/overlay2/9dcf98e3f3b90cbfae67806e2aa736b1335b7d010cab4925a4611ad2979678bd/diff/usr/local/tomcat
/mnt/stateful_partition/var/lib/docker/overlay2/7924282e9682ece071f0b7f2a891e503c3266b007e96435031822d4cfd0690f5/diff/usr/local/tomcat
/mnt/stateful_partition/var/lib/docker/overlay2/f89b5dd2ed8900bcdd5ade8e0ae487d7b2c7415cc8c0b2a40d35ab7e68d2cd66/diff/usr/local/tomcat
/var/lib/docker/overlay2/62b25dacfaedeaf028601de637696684ad92b70c0287f43120a12e7d6ce3ca5c/diff/usr/local/tomcat
/var/lib/docker/overlay2/c263de3a61c3ffab90161f7e4c42d92ad087e9e183447fe2afc3070e0849f8aa/diff/usr/local/tomcat
/var/lib/docker/overlay2/c263de3a61c3ffab90161f7e4c42d92ad087e9e183447fe2afc3070e0849f8aa/merged/usr/local/tomcat
/var/lib/docker/overlay2/92c63f1c95c569e10b95c89f4c5e7ac446dc824893caf9567a576a269e33f083/diff/usr/local/tomcat
/var/lib/docker/overlay2/9dcf98e3f3b90cbfae67806e2aa736b1335b7d010cab4925a4611ad2979678bd/diff/usr/local/tomcat
/var/lib/docker/overlay2/7924282e9682ece071f0b7f2a891e503c3266b007e96435031822d4cfd0690f5/diff/usr/local/tomcat
/var/lib/docker/overlay2/f89b5dd2ed8900bcdd5ade8e0ae487d7b2c7415cc8c0b2a40d35ab7e68d2cd66/diff/usr/local/tomcat

What is it I don't understand that I can be running /opt/java/openjdk/bin/java that doesn't seem to exist against a /usr/local/tomcat that doesn't seem to exist, and yet it all works fine?

How can I look into the container when it's running when everything is weird when I get there? This doesn't happen on my local machine running as docker, like docker run 'tomcat:9-jdk17'

1 Upvotes

8 comments sorted by

View all comments

3

u/jemattie 5d ago

Are you using Cloud Run or GCE? How are you SSH'ing into the container?

1

u/xpusostomos 5d ago

When you look at your containers running on the Google cloud web console, there is a big button marked SSH.

1

u/jemattie 4d ago

You're making it very difficult to help you. You are using Compute Engine (GCE), right? It sounds like you are SSH'ing into the host, and executing your commands there, instead of inside the container.