I have installed Linux subsystem and windows terminal. I ran image using docker (command of the form docker run -it ...... where "......" refers to further part of syntax).
After running of command finished, my current directory (which was PS C:\Users\krs>) changed to root@ad02e79cfb5b and i saw my project directory (say ProjectX) there (it was highlisghted in green) along with other directories like lib,tmp,bin (similar to linux directories in root folder).
However I don't know where root@ad02e79cfb5b:/# is present. I thought it might be root directory but when i open root directory there are folders like lib,tmp,bin but not ProjectX. I am also not able to open root@ad02e79cfb5b:/# using command cd root@ad02e79cfb5b:/#.
Where is root@ad02e79cfb5b:/# located ? How to access it again once I closed it?
When you run docker run
with the -it
flag it will run the container and give you a shell into it.
So the root@ad02e79cfb5b:/#
you were seeing was the prompt inside the docker container (root
is the user, ad02e79cfb5b
is the host name and /
means you are in the root folder).
To get back into it you first need to know if the container is still running. To achieve this run docker ps -a
(not the thant the -a
flag is important as without it you will only see running containers and not stopped ones).
If the container you ran is still running then note the id and run docker exec -it <container-id> /bin/bash
to get a shell back to it.
If the container is stopped then I would suggest removing it docker rm <container-id>
and re-running it (docker run -it ...
).