Skip to content

Commit

Permalink
Adding socat to the haproxy container
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed Oct 18, 2016
1 parent 8f48370 commit a0019cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions haproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ LABEL ImageOS=centos7
LABEL Version=$version

RUN apt-get update && apt-get install -y socat
COPY container_files/ /opt
copy conf/haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
1 change: 1 addition & 0 deletions haproxy/conf/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
stats socket /usr/local/etc/haproxysock level admin

defaults
log global
Expand Down
2 changes: 2 additions & 0 deletions haproxy/container_files/bin/haproxycfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "$@" | socat unix-connect:/usr/local/etc/haproxysock stdio
7 changes: 6 additions & 1 deletion tests/haproxy.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ load ../common

@test "socat process exists" {
docker exec -i haproxy which socat
}
}

@test "socat helper process exists" {
docker exec -i haproxy /opt/bin/haproxycfg.sh show stat
}

0 comments on commit a0019cc

Please sign in to comment.