docker-compose build freeze。没有错误

问题描述 投票:0回答:1

我有docker-compose,它有7个服务。

这里 :

version: '3'
    networks:   default:
    external:
      name: rss-network
       volumes:   shared-xml: 
       services:      mysql:
    image: db
    hostname: mysql
    build:
      context: ./Database
      dockerfile: Dockerfile
    container_name: mysql
    ports:
      - "3306:3306"
      - "33060:33060"       
    webui:
    image: webui
    build:
      context: ./
      dockerfile: Dockerfile.webui
    container_name: webui
    volumes:
      - shared-xml:/rss
    environment:
      - "ConnectionString={$cstring}"
         message.api:
    image: message 
    build:
      context: ./
      dockerfile: Dockerfile.message
    container_name: message
    volumes:
      - shared-xml:/rss
    environment:
      - "RabbitMq/Host={$host}"
      - "token={$token}"
      - "ConnectionString={$cstring}"
    links:
      - rabbit
    depends_on:
      - rabbit    
         rabbit:
    image: rabbitmq:3.7.2-management
    hostname: rabbit
    container_name: rabbit
    ports:
      - "15672:15672"
      - "5671:5671"
      - "15671:15671"
      - "5672:5672"
      - "4369:4369"
           tracker:
    image: tracker
    build:
      context: ./
      dockerfile: Dockerfile.tracker
    container_name: tracker
    environment:
      - "RabbitMq/Host={$host}"
    volumes:
      - shared-xml:/rss
    links:
      - rabbit
      - message.api
    environment:
      - "ConnectionString={$cstring}"
    depends_on:
      - mysql

  botCenter:
    image: botCenter
    build:
      context: ./
      dockerfile: Dockerfile.botCenter
    container_name: botCenter
    environment:
      - "ConnectionString={cstring}"
      - "bot-token={$token}"
         feeding:
    image: feeder
    build:
      context: ./
      dockerfile: Dockerfile.feeder
    container_name: feeder
    environment:
      - "RabbitMq/Host={$host}"
    volumes:
      - shared-xml:/rss
    links:
      - rabbit
      - message.api

在docker-compose之后--verbose build freeze在这里

...
    Removing intermediate container b160ead77128
     ---> 6cce30feb98f
    Successfully built 6cce30feb98f
    Successfully tagged webui:latest
    compose.cli.verbose_proxy.proxy_callable: docker close <- ()
    compose.cli.verbose_proxy.proxy_callable: docker close -> None
    compose.service.build: Building mysql
    compose.cli.verbose_proxy.proxy_callable: docker build <- (path='C:\\Users\\TYılmaz\\Documents\\GitHub\\tracker\\RSSTracker\\Database', tag='db', rm=True, forcerm=False, pull=False, nocache=False, dockerfile='Dockerfile', cache_from=None, labels=None, buildargs={}, network_mode=None, target=None, shmsize=None, extra_hosts=None, container_limits={'memory': None})
    docker.api.build._set_auth_headers: Looking for auth config
    docker.auth.resolve_authconfig: Using credentials store "wincred"
    docker.auth._resolve_authconfig_credstore: Looking for auth entry for 'https://index.docker.io/v1/'
    docker.auth.resolve_authconfig: Using credentials store "wincred"
    docker.auth._resolve_authconfig_credstore: Looking for auth entry for 'xmlparser.azurecr.io'
    docker.api.build._set_auth_headers: Sending auth config ('https://index.docker.io/v1/', 'xmlparser.azurecr.io')
    urllib3.connectionpool._make_request: http://localhost:None "POST /v1.25/build?t=db&q=False&nocache=False&rm=True&forcerm=False&pull=False&dockerfile=Dockerfile HTTP/1.1" 200 None
    compose.cli.verbose_proxy.proxy_callable: docker build -> <generator object APIClient._stream_helper at 0x000002463460F8E0>
    Step 1/6 : FROM mysql/mysql-server:latest
     ---> 02d081b9c73e
    Step 2/6 : env MYSQL_USER=userid
     ---> Using cache
     ---> e0e302b9630d
    Step 3/6 : env MYSQL_PASSWORD=pw
     ---> Using cache
     ---> 2e05dc0f1c59
    Step 4/6 : env MYSQL_DATABASE=db
     ---> Using cache
     ---> 3184d46769f8
    Step 5/6 : env MYSQL_RANDOM_ROOT_PASSWORD="w"
     ---> Using cache
     ---> 0aa292e5180f
    Step 6/6 : ADD my.sql /docker-entrypoint-initdb.d
     ---> Using cache
     ---> c7afd14beb7a
    Successfully built c7afd14beb7a
    Successfully tagged db:latest
    compose.cli.verbose_proxy.proxy_callable: docker close <- ()
    compose.cli.verbose_proxy.proxy_callable: docker close -> None
    compose.service.build: Building botCenter
    compose.cli.verbose_proxy.proxy_callable: docker build <- (path='C:\\Users\\TYılmaz\\Documents\\GitHub\\tracker\\RSSTracker', tag='botCenter', rm=True, forcerm=False, pull=False, nocache=False, dockerfile='Dockerfile.botCenter', cache_from=None, labels=None, buildargs={}, network_mode=None, target=None, shmsize=None, extra_hosts=None, container_limits={'memory': None})
    docker.api.build._set_auth_headers: Looking for auth config
    docker.auth.resolve_authconfig: Using credentials store "wincred"
    docker.auth._resolve_authconfig_credstore: Looking for auth entry for 'https://index.docker.io/v1/'
    docker.auth.resolve_authconfig: Using credentials store "wincred"
    docker.auth._resolve_authconfig_credstore: Looking for auth entry for 'xmlparser.azurecr.io'
    docker.api.build._set_auth_headers: Sending auth config ('https://index.docker.io/v1/', 'xmlparser.azurecr.io') 

docker-compose必须继续建设,但有些不对劲,我不明白出了什么问题。当我构建docker-compose时,它会冻结botCenter服务。其他服务显然有效。

这里我的botCenter服务dockerfile:

FROM microsoft/dotnet:2.0.0-sdk
WORKDIR /app
COPY *.sln ./
COPY ./BusinessLogic/*.csproj ./BusinessLogic/
COPY ./DataAccess/*.csproj ./DataAccess/
COPY ./Microservices/Message/*.csproj ./Microservices/Message/
COPY ./Microservices/Tracker/*.csproj ./Microservices/Tracker/
COPY ./Microservices/BotCenter/*.csproj ./Microservices/BotCenter/
COPY ./Microservices/Feeding/*.csproj ./Microservices/Feeding/
RUN dotnet restore
COPY . .
RUN dotnet publish -c Release -o out
ENTRYPOINT ["dotnet", "Microservices/BotCenter//out/BotCenter.dll"]

使用此docker命令时,此dockerfile已成功构建:“

docker build -f dockerfile -t test2021。

"

请帮帮我。

docker service .net-core docker-compose console-application
1个回答
1
投票

尝试将任何大文件/文件夹添加到.dockerignore

© www.soinside.com 2019 - 2024. All rights reserved.