社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

saeed

saeed 最近回复了

根据 Docker Run Docs :

-P         : Publish all exposed ports to the host interfaces
-p=[]      : Publish a container's port or a range of ports to the host
               format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
               Both hostPort and containerPort can be specified as a
               range of ports. When specifying ranges for both, the
               number of container ports in the range must match the
               number of host ports in the range, for example:
                   -p 1234-1236:1234-1236/tcp
5 年前
回复了 saeed 创建的主题 » Docker容器状态未启动

你使用了多个 " 在你的指挥下 escape characters 或 ' .你的命令应该是这样的:

docker run -d -it -i -t --name test ubuntu sh -c "echo 'Input website:'; read website; echo 'Searching..'; sleep 1; curl 'http:\\$website;'"

或者:

docker run -d -it -i -t --name test ubuntu sh -c "echo \"Input website:\"; read website; echo \"Searching..\"; sleep 1; curl 'http:\\$website;'"

或者如果它不起作用,你可以改变 http:// 到 http:\/\/ 如果它仍然不起作用,这可能会对你有所帮助。