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

更新Docker Desktop后Rails容器无法访问且日志为空

Docker Desktop v4.17.0更新后Rails容器启动但无法访问且无日志输出

昨日将Docker Desktop更新至v4.17.0版本后,我的Docker Compose配置中的主Rails容器(web)虽显示处于启动状态,但无法通过常规端口访问,且期间未修改任何代码。此外,该容器无任何日志输出——正常情况下在Docker Desktop中点击web容器能看到Rails启动过程的日志,当前日志却完全为空。

以下是我的截断版Compose文件和Dockerfile:

docker-compose.yml

version: '3.9'

services:

  # web service (connected to local DB)
  web: &web
    container_name: web
    env_file: .env
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 2G
    build:
        context: .
        dockerfile: Dockerfile
    command: /bin/sh -c "rm -f /app/tmp/pids/server.pid && gem install bundler -v 2.2.21 && bundle install && rails db:migrate && rails server --port 3000 --binding 0.0.0.0"
    ports:
      - 3000:3000
      - 5432:5432
    volumes:
      - ../:/app:cached
      - bundle:/usr/local/bundle
      - rails_cache:/app/tmp/cache
      - node_modules:/app/node_modules
    depends_on:
      - db
    profiles:
      - app
      - appnm

volumes:
  web:
  bundle:
  node_modules:
  rails_cache:

Dockerfile

FROM ruby:2.7.4
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y nodejs
ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
EXPOSE 3000

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.28 13:35:10