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

前端 未结 22 1807
孤独总比滥情好
孤独总比滥情好 2020-12-12 23:07

Ran into this Docker error with one of my projects:

invalid reference format: repository name must be lowercase

What are the various causes for

相关标签:
22条回答
  • 2020-12-12 23:51

    sometimes you miss -e flag while specific multiple env vars inline

    e.g. bad: docker run --name somecontainername -e ENV_VAR1=somevalue1 ENV_VAR2=somevalue2 -d -v "mypath:containerpath" <imagename e.g. postgres>

    good: docker run --name somecontainername -e ENV_VAR1=somevalue1 -e ENV_VAR2=somevalue2 -d -v "mypath:containerpath" <imagename e.g. postgres>

    0 讨论(0)
  • 2020-12-12 23:52

    This is happening because of the spaces in the current working directory that came from $(pwd) for map volumes. So, I used docker-compose instead.

    The docker-compose.yml file.

    version: '3'
    services:
      react-app:
        build:
          context: .
          dockerfile: Dockerfile.dev
        ports:
          - "3000:3000"
        volumes:
          - /app/node_modules
          - .:/app
    
    0 讨论(0)
  • 2020-12-12 23:52

    Most of the answers above did not work for my case, so I will document this in case somebody finds it helpful. The first line in the dockerfile FROM node:10 for my case, the word node should not be uppercase i.e FROM NODE:10. I made that change and it worked.

    0 讨论(0)
  • 2020-12-12 23:53

    In my case was the -e before the parameters for mysql docker

    docker run --name mysql-standalone -e MYSQL_ROOT_PASSWORD=hello -e MYSQL_DATABASE=hello -e MYSQL_USER=hello -e MYSQL_PASSWORD=hello -d mysql:5.6
    

    Check also if there are missing whitespaces

    0 讨论(0)
  • 2020-12-12 23:53

    had a space in the current working directory and usign $(pwd) to map volumes. Doesn't like spaces in directory names.

    0 讨论(0)
  • 2020-12-12 23:55

    "docker build -f Dockerfile -t SpringBoot-Docker ." As in the above commend, we are creating an image file for docker container. commend says create image use file(-f refer to docker file) and -t for the target of the image file we are going to push to docker. the "." represents the current directory

    solution for the above problem: provide target image name in lowercase

    0 讨论(0)
提交回复
热议问题