dockerfile always create <none>image

Viewed 16

dockerfile:

# Build
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /source
COPY . .
RUN dotnet restore "./GraphQL/GraphQL.csproj" --disable-parallel
RUN dotnet publish "./GraphQL/GraphQL.csproj" -c release -o /app --no-restore
RUN mkdir -p /app/MyStaticFiles

# Server
FROM  mcr.microsoft.com/dotnet/aspnet:6.0-focal
WORKDIR /app
COPY --from=build /app .
EXPOSE 80
ENTRYPOINT ["dotnet", "GraphQL.dll"]

none image is not created when all server parts are annotated

docker-compose.yml:

version: '3'
services:
  db:
    image: mariadb
    restart: always
    environment:
      - MARIADB_USER=test
      - MARIADB_PASSWORD=Test123*
      - MARIADB_ROOT_PASSWORD=Test123*
    container_name: test-mariadb
    networks:
      test_net:
        ipv4_address: 10.5.0.5

  test:
    image: test-api
    build:
      context: .
      dockerfile: dockerfile
    container_name: test-api
    ports:
      - "8080:80"
    networks:
      test_net:
        ipv4_address: 10.5.0.6
    depends_on:
      - db

networks:
  test_net:
    driver: bridge
    ipam:
      config:
        - subnet: 10.5.0.0/16

when I up docker-compose maria db is working well but api is not working. how can I fix it?

I'm working with wsl-ubuntu and dotnet, docker

0 Answers
Related