Padma Channal
Padma Channal

Reputation: 104

Docker: Not a valid repository:

I am trying to connect Hubot with Rocketchat using Docker. My commands are:

docker run -it -e ROCKETCHAT_URL=<your rocketchat instance>:<port> \
               -e ROCKETCHAT_ROOM='' \
               -e LISTEN_ON_ALL_PUBLIC=true \
               -e ROCKETCHAT_USER=bot \
               -e ROCKETCHAT_PASSWORD=bot \
               -e ROCKETCHAT_AUTH=password \
               -e BOT_NAME=bot \
               -e EXTERNAL_SCRIPTS=hubot-pugme,hubot-help \
                rocketchat/hubot-rocketchat

My input is: U:\myhubot>docker run -it -e ROCKETCHAT_URL=https://spree.chat/channel/:3000

But Docker is saying: docker: Error parsing reference: "\" is not a valid repository/tag: invalid reference format.

I checked for version of Docker and it is right. This is the only solution on web-browser. What is the solution for this?

Screenshot:

Docker Error

Upvotes: 1

Views: 1216

Answers (3)

Rao
Rao

Reputation: 21389

The command is in unix style where \ represents command continuous on next line.

Since you are using windows platform, use entire command in single line i.e., remove \ and bring all the lines in single line.

Try below:

docker run -it -e ROCKETCHAT_URL="<your rocketchat instance>:<port>" -e ROCKETCHAT_ROOM="" -e LISTEN_ON_ALL_PUBLIC=true -e ROCKETCHAT_USER=bot -e ROCKETCHAT_PASSWORD=bot -e ROCKETCHAT_AUTH=password -e BOT_NAME=bot -e EXTERNAL_SCRIPTS="hubot-pugme,hubot-help" rocketchat/hubot-rocketchat

Upvotes: 0

Dan Lowe
Dan Lowe

Reputation: 56667

The text of the command in your question is across multiple lines, using the \ character to continue to the next line and add more to the command.

First, this is a Unix convention, but you are using Windows. On Windows, \ is a directory separator character, not a line continuation character. On Windows, to continue to the next line, I believe you use ^ instead.

Second, in your screenshot you seem to be using \ in the command, but it is all one line. The command continues on the same line after it. So Docker is seeing \ where it expects to find an image name, and tries to use it as that. But that's not valid, so it complains and tells you so.

If you will use this command on one line, simply remove the \ characters.

If you will use this across multiple lines, I believe you should be using ^ instead, as shown in this answer.

See also jdno's answer which is a different problem you are probably going to run into after you fix this one.

Upvotes: 2

jdno
jdno

Reputation: 4364

The correct format for a URL is protocol://domain:port/path/filename, so the URL should be https://spree.chat:3000/channel/. Docker doesn't expect :3000 and thus fails parsing the command.

Looking at the documentation for the Rocket.Chat Hubot Adapter, it seems to me that you only need to specify host:port, i.e. https://spree.chat:3000. But that's just a guess...

Upvotes: 1

Related Questions