You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker容器已停止但页面仍可访问,无法停止本地运行容器

Troubleshooting Your Docker Container Issues

Hey there! Let's work through these two Docker problems you're facing—they're pretty common, so we'll get them sorted out.

1. Container is stopped, but the website still loads in the browser

This almost always boils down to one of two things:

  • Browser caching: Your browser might have stored a local copy of the page. Try a hard refresh with Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (macOS), or open an incognito/private window to load the page again. If it doesn't show up there, the cache was the culprit.
  • Another service using port 80: It's possible another process on your machine is listening on port 80. To check:
    • On Windows: Run netstat -ano | findstr ":80" in Command Prompt/PowerShell to find the process ID (PID) using the port, then match it in Task Manager.
    • On Linux/macOS: Run lsof -i :80 or netstat -tulpn | grep :80 to identify the process using port 80.

2. Can't stop the container

Let's go through steps to forcefully stop/remove the unresponsive container:

  1. First, get your container ID/name from the output of docker ps -a (you already know this works, so grab that identifier).
  2. Try a forceful stop: Run docker stop -t 0 <container-id-or-name>—the -t 0 skips the graceful shutdown period and terminates the container immediately.
  3. If stopping fails, force delete the container: Use docker rm -f <container-id-or-name>—this command will kill the container process and remove it in one go.
  4. Restart the Docker daemon: If the above steps don't work, the Docker service might be in a stuck state.
    • Windows: Open Task Manager, find "Docker Desktop" in the Processes tab, right-click and select "Restart".
    • Linux: Run sudo systemctl restart docker.
    • macOS: Open Docker Desktop, click the menu bar icon, select "Restart".
  5. Kill residual host processes (last resort): If the container is still hanging, check for leftover processes on your host machine. Run ps aux | grep <your-container-image-name> to find related PIDs, then terminate them with kill -9 <pid>. After that, you should be able to clean up the container with docker rm -f <container-id-or-name>.

内容的提问来源于stack exchange,提问作者Neer Patel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:47:52