yesIcan
yesIcan

Reputation: 1701

Docker-compose error: invalid reference format: repository name must be lowercase

I am working on microservice using docker on visual studio 2017. I’ve been dealing with this error for half a day.

Severity    Code    Description Project File    Line    Suppression State
Error       Creating network "dockercompose8357222465790585823_default" with the default driver
Building Pricing.api
invalid reference format: repository name must be lowercase.

Here is the compose content version: '3'

services:
  Pricing.api:
    image: Pricing.api
    build:
      context: ../PricingAPI
      dockerfile: Dockerfile

and docker file

FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "PricingAPI.dll"]

Here is the ci version: '3'

services:
  ci-build:
    image: microsoft/aspnetcore-build:2.0-2.0
    volumes:
      - .:/src
    working_dir: /src
    command: /bin/bash -c "dotnet restore ./Pricing.MicroService.sln && dotnet publish ./Pricing.MicroService.sln -c Release -o ./obj/Docker/publish"

what is it referring when it says by repository ?

Upvotes: 5

Views: 10800

Answers (1)

yesIcan
yesIcan

Reputation: 1701

It turns out that by repository it meant ‘service’. I updated service name as show bellow and it works.

 services:
      Pricing.api: => pricing.api with lowercase ‘p’
        environment:
          - ASPNETCORE_ENVIRONMENT=Development
        ports:
          - "80"

It should have said

invalid reference format. Service name must be lowercase .

This is a confusing error message. This is something Docker team has to fix imo.

Upvotes: 7

Related Questions