首頁  >  文章  >  運維  >  如何解決docker存取頁面出錯

如何解決docker存取頁面出錯

WJ
WJ原創
2020-06-05 15:41:352546瀏覽

如何解決docker存取頁面出錯

如何解決docker存取頁面出錯?

如何解決docker存取頁面出錯

#建立容器

(django31) pyvip@VIP:~$ docker container start test
test
(django31) pyvip@VIP:~$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
bf38f67f54fb        tomcat              "catalina.sh run"   15 minutes ago      Up 15 minutes       0.0.0.0:9999->8080/tcp   demo
e6401b123eb8        tomcat              "catalina.sh run"   20 minutes ago      Up 4 seconds        0.0.0.0:8080->8080/tcp   test

進入/bin/bash 查看

(django31) pyvip@VIP:~$ docker exec -it bf38 /bin/bash
root@bf38f67f54fb:/usr/local/tomcat# ls
BUILDING.txt LICENSE  README.md RUNNING.txt  conf     lib   native-jni-lib  webapps   work
CONTRIBUTING.md  NOTICE   RELEASE-NOTES  bin      include  logs  temp     webapps.dist

進入webapps檔案下查看是否有文件,這裡沒有,所以我刪了,查看webapps.dist

root@bf38f67f54fb:/usr/local/tomcat# cd webapps
root@bf38f67f54fb:/usr/local/tomcat/webapps# ls
root@bf38f67f54fb:/usr/local/tomcat/webapps# rm -r webapps
rm: cannot remove 'webapps': No such file or directory

複製一份,

root@bf38f67f54fb:/usr/local/tomcat# rm -r webapps
root@bf38f67f54fb:/usr/local/tomcat# ls
BUILDING.txt LICENSE  README.md RUNNING.txt  conf     lib   native-jni-lib  webapps.dist
CONTRIBUTING.md  NOTICE   RELEASE-NOTES  bin      include  logs  temp     work
root@bf38f67f54fb:/usr/local/tomcat# cp -r webapps.dist/ webapps
root@bf38f67f54fb:/usr/local/tomcat# ls
BUILDING.txt LICENSE  README.md RUNNING.txt  conf     lib   native-jni-lib  webapps   work
CONTRIBUTING.md  NOTICE   RELEASE-NOTES  bin      include  logs  temp     webapps.dist

ok,重新訪問,

如何解決docker存取頁面出錯



以上是如何解決docker存取頁面出錯的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
上一篇:docker特色總結下一篇:docker特色總結