Skip to content

Commit

Permalink
Merge pull request #18 from docker/socat
Browse files Browse the repository at this point in the history
Socat
  • Loading branch information
Jim Van Fleet committed Oct 18, 2016
2 parents f651e7f + 494d9c5 commit 3482929
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ node('docker') {
dir('haproxy'){
sh 'docker build --rm -t my/haproxy . > debug'
sh 'rm debug'
sh 'docker rm haproxy'
}
} catch(error) {
def error_details = readFile('haproxy/debug');
Expand Down Expand Up @@ -124,6 +123,8 @@ def handleError(String message, String tag, Boolean doCleanup = true){
def cleanup(String tag) {
try{
sh 'bin/decompose.sh &> debug'
sh 'docker rm haproxy'
sh 'docker rmi my/haproxy'
sh 'bin/prune.sh &> debug'
} catch(error) {
def error_details = readFile('./debug');
Expand Down
3 changes: 3 additions & 0 deletions haproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ LABEL ImageType="haproxy"
LABEL ImageName=$imagename
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
14 changes: 14 additions & 0 deletions tests/haproxy.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bats

load ../common

# These tests assume the pipeline will start and stop the container.

@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 3482929

Please sign in to comment.