Docker学习记录:装tomcat
--rm这个参数是指,容器关闭后将自己删除自己。主要用来测试。
1.sudo docker pull tomcat
2.sudo docker run -d -p 3355:8080 --name tomcat01 tomcat
3.查看
4.完善
kt@kt-SYS-4028GR-TR2:~$ sudo docker exec -it tomcat01 /bin/bash
root@8890b10f1628:/usr/local/tomcat# dir
bin conf lib logs NOTICE RELEASE-NOTES temp webapps.dist
BUILDING.txt CONTRIBUTING.md LICENSE native-jni-lib README.md RUNNING.txt webapps work
root@8890b10f1628:/usr/local/tomcat# ls
bin conf lib logs NOTICE RELEASE-NOTES temp webapps.dist
BUILDING.txt CONTRIBUTING.md LICENSE native-jni-lib README.md RUNNING.txt webapps work
root@8890b10f1628:/usr/local/tomcat# ls -al
total 176
drwxr-xr-x 1 root root 4096 Dec 10 01:29 .
drwxr-xr-x 1 root root 4096 Dec 10 01:28 ..
drwxr-xr-x 2 root root 4096 Dec 10 01:29 bin
-rw-r--r-- 1 root root 21039 Dec 5 15:19 BUILDING.txt
drwxr-xr-x 1 root root 4096 Jan 6 05:12 conf
-rw-r--r-- 1 root root 6166 Dec 5 15:19 CONTRIBUTING.md
drwxr-xr-x 2 root root 4096 Dec 10 01:29 lib
-rw-r--r-- 1 root root 60517 Dec 5 15:19 LICENSE
drwxrwxrwt 1 root root 4096 Jan 6 05:12 logs
drwxr-xr-x 2 root root 4096 Dec 10 01:29 native-jni-lib
-rw-r--r-- 1 root root 2333 Dec 5 15:19 NOTICE
-rw-r--r-- 1 root root 3291 Dec 5 15:19 README.md
-rw-r--r-- 1 root root 6469 Dec 5 15:19 RELEASE-NOTES
-rw-r--r-- 1 root root 16109 Dec 5 15:19 RUNNING.txt
drwxrwxrwt 2 root root 4096 Dec 10 01:29 temp
drwxr-xr-x 2 root root 4096 Dec 10 01:29 webapps
drwxr-xr-x 7 root root 4096 Dec 5 15:19 webapps.dist
drwxrwxrwt 2 root root 4096 Dec 5 15:19 work
root@8890b10f1628:/usr/local/tomcat# cd webapps
root@8890b10f1628:/usr/local/tomcat/webapps# ls
root@8890b10f1628:/usr/local/tomcat/webapps#
root@8890b10f1628:/usr/local/tomcat/webapps# cd..
bash: cd..: command not found
root@8890b10f1628:/usr/local/tomcat/webapps# cd.
bash: cd.: command not found
root@8890b10f1628:/usr/local/tomcat/webapps# cd ..
root@8890b10f1628:/usr/local/tomcat# cd webapps.dist
root@8890b10f1628:/usr/local/tomcat/webapps.dist# ls
docs examples host-manager manager ROOT
root@8890b10f1628:/usr/local/tomcat/webapps.dist# cp . ../webapps
cp: -r not specified; omitting directory '.'
root@8890b10f1628:/usr/local/tomcat/webapps.dist# cp -r . ../webapps
root@8890b10f1628:/usr/local/tomcat/webapps.dist# cd ..
root@8890b10f1628:/usr/local/tomcat# cd webapps
root@8890b10f1628:/usr/local/tomcat/webapps# ls
docs examples host-manager manager ROOT
root@8890b10f1628:/usr/local/tomcat/webapps#
5.测试: