Error response from daemon: (config) includes invalid characters for local volume name
I have a running node server that is listening on 3 different ports. I have three different url subdomains pointing to the port of the 80
server that node is running on.
What I am trying to do is proxy the request from the subdomain to the appropriate port using haproxy
.
My node server is connected to ports open on the host. I can hit them individually using the server IP on my port to make them look fine.
My haproxy
will also run inside a docker container. I'm completely new to haproxy
, although I'm pretty confident about docker. I wrote haproxy config via onine articles and blogs, but as soon as I started the docker container using:
docker run --name my-running-haproxy \
-v ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
haproxy:1.6.2
I am getting the following error:
Error response from daemon: ./ haproxy.cfg contains invalid characters for local volume name, only allowed [a-zA-Z0-9] [a-zA-Z0-9 _.-]
So, I tried debugging by removing the config options until I had a very minimal config:
haproxy.cfg
global
maxconn 256
debug
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http-in
bind *:80
default_backend default-server
backend default-server
server s0 127.0.0.1:3000
But still I am getting the same error.
Can anyone help me with this?
source to share
I had the same problem and solved it using the full path to my config file.
Original
docker run --name my-running-haproxy \
-v ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
haproxy:1.6.2
Fixed
docker run --name my-running-haproxy \
-v /usr/local/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
haproxy:1.6.2
source to share
$ docker -v
Docker version 1.11.2, build b9f10c9
Using a relative path:
Example:
./haproxy.cfg
Example:
./PATH/haproxy.cfg
An example of a hidden file:
./PATH/.haproxy.cfg
-v ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
Using an absolute path:
Example:
/haproxy.cfg
Example:
/PATH/haproxy.cfg
An example of a hidden file:
/PATH/.haproxy.cfg
Example:
$PWD/haproxy.cfg
-v /PATH/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
source to share