by XDK
25. August 2019 17:37
Explanation:
Command to get the name of the existing container
ubuntu@ip-172-31-57-91:/opt/HelloWorld$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2a41bd524e93 xdkdockerhub/xdkdockerrepo:xdk_helloworld_V1 "catalina.sh run" 5 minutes ago Up 5 minutes 0.0.0.0:80->8080/tcp sweet_hypatia
Command to get a bash shell in the container.
ubuntu@ip-172-31-57-91:/opt/HelloWorld$ docker exec -it sweet_hypatia bash
Verify with basic commands
root@2a41bd524e93:/usr/local/tomcat# ls -a
. BUILDING.txt LICENSE README.md RUNNING.txt conf lib native-jni-lib webapps
.. CONTRIBUTING.md NOTICE RELEASE-NOTES bin include logs temp work
root@2a41bd524e93:/usr/local/tomcat# ls -al
total 168
drwxr-sr-x 1 root staff 4096 May 16 00:50 .
drwxrwsr-x 1 root staff 4096 May 8 13:20 ..
-rw-r--r-- 1 root root 19539 May 4 09:22 BUILDING.txt
-rw-r--r-- 1 root root 5407 May 4 09:22 CONTRIBUTING.md
-rw-r--r-- 1 root root 57092 May 4 09:22 LICENSE
-rw-r--r-- 1 root root 1726 May 4 09:22 NOTICE
-rw-r--r-- 1 root root 3255 May 4 09:22 README.md
-rw-r--r-- 1 root root 7139 May 4 09:22 RELEASE-NOTES
-rw-r--r-- 1 root root 16262 May 4 09:22 RUNNING.txt
drwxr-xr-x 2 root root 4096 May 16 00:50 bin
drwxr-sr-x 1 root root 4096 Aug 25 11:56 conf
drwxr-sr-x 2 root staff 4096 May 16 00:50 include
drwxr-xr-x 2 root root 4096 May 16 00:49 lib
drwxrwxrwx 1 root root 4096 Aug 25 11:56 logs
drwxr-sr-x 3 root staff 4096 May 16 00:50 native-jni-lib
drwxr-xr-x 2 root root 4096 May 16 00:49 temp
drwxr-xr-x 1 root root 4096 Aug 25 11:56 webapps
drwxrwxrwx 1 root root 4096 Aug 25 11:56 work
root@2a41bd524e93:/usr/local/tomcat# exit
exit
ubuntu@ip-172-31-57-91:/opt/HelloWorld$