SAP-samples / cloud-btp-cli-api-codejam

Material for the CodeJam on the CLI and APIs for the SAP Business Technology Platform.
Apache License 2.0
24 stars 8 forks source link

How to open terminal from Docker GUI #12

Closed marianfoo closed 2 years ago

marianfoo commented 2 years ago

When you open the terminal from the Docker GUI as a external terminal, you need to run bash:

image image

Would good if this is in the documentation as well

qmacro commented 2 years ago

Not being a GUI-first user, I've never done this before, so I tried it and got the same result. So I did some research, and using the "CLI" feature from the Docker Desktop GUI places you in a sh environment. According to the Docker Desktop GUI documentation for this, the Explore Containers section says:

You also have the option to open an integrated terminal, on a running container, directly within Docker Desktop. This allows you to quickly execute commands within your container so you can understand its current state or debug when something goes wrong. Using the integrated terminal is the same as running docker exec -it <container-id> /bin/sh

This makes sense, in that it allows you to connect to an already running container in the normal (exec) way and is not the equivalent of launching a fresh container instance (where the CMD would be carried out).