#SharePointProblems | Koskila.net

Solutions are worthless unless shared! Antti K. Koskela's Personal Professional Blog

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

β€’ koskila
Reading Time 2 min
Word Count 297 words
Comments 2 comments
Rating 5 (3 votes)
View

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 πŸ˜‚

Comments

Interactive comments not implemented yet. Showing legacy comments migrated from WordPress.
Amine
2022-08-02 13:46:03)
Thanks, I wasted a couple of hours, rewrote the whole line and voila, sorted cheers
Antti K. Koskela
2022-08-05 16:27:25
Thanks for your comment, Amine! Happy to hear it was helpful, but geez is that annoying... πŸ˜…
Whitewater Magpie Ltd.
β€’
Β© 2025
Static Site Generation timestamp: 2025-08-21T07:25:07Z