. Advertisement .
..3..
. Advertisement .
..4..
The error
invalid reference format: repository name must be lowercase
occurred when I worked on my project in Docker. I’ve tried to fix it for some days but have not resolved it yet. Can someone suggest a relevant solution to fix the ”docker: invalid reference format: repository name must be lowercase” issue? Much appreciate your support.
The cause:
The string you gave cannot be converted into an image by docker. When you execute the image using the docker run command line, this could be an invalid name or the result of a parsing issue earlier in the command line. Or in the case you use all capital letters in the name of your register or repository. When using the docker run command line, this frequently happens as a result of failing to quote parameters with spaces, forgetting the value of an argument, and misreading the command line’s order. Another reason is that a volume mapping is expanding a route name with a space in it when delivering arguments to the run and neither quoting the path or escaping the space. These are the reasons of your error.
Solution:
If you try to run
Project:latest
with the commandDir:/data image_ref
while in the directory/home/user/Some Project Dir
, that will define an anonymousvolume /home/user/Some
in your container. And here’s how to solve that, let’s use:If the environment variables are missed:
Which docker will consider this as attempting to execute the command
Spaces image_ref
while using the imageWith:latest
. The solution is using the environment parameter:In case you have:
Let’s check carefully whether that your_image_name is declared as an all-lower case string or not.
Docker does not allow mixed characters, let me emphasize that.
Good:
docker build -t myfirstechoimage:0.1 .
Bad:
docker build -t myFirstEchoImage:0.1 .