Docker port 開不起來 - Linux
By Zora
at 2021-07-25T20:41
at 2021-07-25T20:41
Table of Contents
自己寫的 Dockerfile
FROM python:3
WORKDIR /home/src/app
COPY requirements.txt /home/src
RUN pip install --no-cache-dir -r /home/src/requirements.txt
CMD [ "python", "app_main.py" ]
EXPOSE 5000
使用 docker run -p 5000:5000 -v src:/home/src/app -ti image 執行
* Serving Flask app 'app_main' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
但是使用 telnet ip:5000 或是 telnet localhost:5000 都只會得到以下結果
Trying ip...
telnet: Unable to connect to remote host: Connection refused
Dockerfile 有 expose,docker run 也有指定 port 但是就是連不到
我有什麼地方搞錯了嗎?
--
FROM python:3
WORKDIR /home/src/app
COPY requirements.txt /home/src
RUN pip install --no-cache-dir -r /home/src/requirements.txt
CMD [ "python", "app_main.py" ]
EXPOSE 5000
使用 docker run -p 5000:5000 -v src:/home/src/app -ti image 執行
* Serving Flask app 'app_main' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
但是使用 telnet ip:5000 或是 telnet localhost:5000 都只會得到以下結果
Trying ip...
telnet: Unable to connect to remote host: Connection refused
Dockerfile 有 expose,docker run 也有指定 port 但是就是連不到
我有什麼地方搞錯了嗎?
--
Tags:
Linux
All Comments
By Lauren
at 2021-07-27T04:59
at 2021-07-27T04:59
By Blanche
at 2021-07-28T13:18
at 2021-07-28T13:18
By Kyle
at 2021-07-29T21:36
at 2021-07-29T21:36
By Tracy
at 2021-07-31T05:54
at 2021-07-31T05:54
Related Posts
bash運算問題
By Adele
at 2021-07-24T05:28
at 2021-07-24T05:28
崑大資傳系「鳥哥」架Linux免費教學網 人氣破四千萬
By Hazel
at 2021-07-24T01:43
at 2021-07-24T01:43
關於網路服務API的問題
By Harry
at 2021-07-23T16:53
at 2021-07-23T16:53
Archlinux installation speedrun
By Isla
at 2021-07-22T21:50
at 2021-07-22T21:50
2021 07 ArchLinux 安裝紀錄
By Isla
at 2021-07-20T02:36
at 2021-07-20T02:36