0

I am new in docker container. I have the latest docker desktop on my Windows PC. I have two asp.net core projects in a Visual Studio solution. Their dockerfiles are the same:

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .

The docker-compose file at the solution level is:

version: '3.4'

services:
  mywebsite:
    image: frankscontainerregistry.azurecr.io/mywebsite
    build:
      context: .\MyWebsite
      dockerfile: Dockerfile
    depends_on:
      - myapi

  myapi:
    image: frankscontainerregistry.azurecr.io/myapi
    build:
      context: .\MyAPI
      dockerfile: Dockerfile

If I run the docker-compose on Visual Studio, it can build the two images OK. But if I open a CMD window and run "docker-compose build", it always stuck indefinitely on the following step:

C:\Users\xxx\Two containers>docker compose build --progress plain
Sending build context to Docker daemon     524B
Step 1/6 : FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
 ---> e2460dcda92c
Step 2/6 : ARG source
 ---> Running in 4ab03ef407eb
Removing intermediate container 4ab03ef407eb
 ---> 1e3e296b3744
Step 3/6 : WORKDIR /inetpub/wwwroot
 ---> Running in 3ebe0d6ab017
Removing intermediate container 3ebe0d6ab017
 ---> fc052446595a
Step 4/6 : COPY ${source:-obj/Docker/publish} .

What is the problem?

0 Answers0