Docker is the unfortunate future

Solving “invalid reference format.” when trying to run almost any docker commands

This post was most recently updated on February 16th, 2023.

2 min read.

So another simple one. (I just seem to run into all of the issues whenever I try to do the simplest thing with Docker!)

Or with anything, I guess – but yeah, that’s another article then. This time about any docker commands failing (no matter what command and with what arguments!)

Problem

I was trying to run a Docker container called Syslog-ng, and had to add quite a few parameters in order to map the volumes and ports that I needed. Any time that I would run it, I’d get a really non-descript error message.

This is what I ran:

docker run -it -v "/c/[path not important]/Syslog/syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf" -v "/c/[path not important]/Syslog/logs:/var/log" -p 514:514 -p 601:601 –name syslog-ng balabit/syslog-ng:latest -edv

And this is what I got in return:

docker: invalid reference format. see 'docker run --help'

And I suspect you might, you might get the same “invalid reference format” error with any Docker commands! That means running docker pull , docker run, docker push or any other command might return the same, annoying and unspecific error; invalid reference format

What do?

Reason

… This was incredibly annoying, but the whole thing was just an issue with Docker not understanding my hyphens, and confusing them with dashes. If you’re like me, and you’re often copy-pasting stuff first from the internet to your text editor on Windows, and then from there to a WSL console or anywhere over an RDP connection, you’ll end up with these encoding/charset related issues from time to time.

Solution

I rewrote each hyphen. That fixed it, but as usual, YMMV – maybe you’ll need to rewrite your forward/backward slashes and colons, too.

(Between you and me, I think that one hyphen before “name” looks a bit suspicious!


As usual, I hope this helps 😂

mm
5 3 votes
Article Rating
Subscribe
Notify of
guest

2 Comments
most voted
newest oldest
Inline Feedbacks
View all comments