1

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

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Padma Channal
  • 94
  • 1
  • 13

3 Answers3

2

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.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
1

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...

jdno
  • 4,104
  • 1
  • 22
  • 27
  • I don't think this is actually causing the cited error, which is complaining about a \ specifically. However, glancing at rocketchat docs, I think your observation is correct and the OP may run into this error at a later point. – Dan Lowe Jun 20 '17 at 15:15
  • Yes I agree with you. I didn't pay close enough attention to the screenshot to notice OP is using Windows and executing the command in a single line. Good job catching that. – jdno Jun 20 '17 at 15:19
0

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
Rao
  • 20,781
  • 11
  • 57
  • 77