Skip to content
Permalink
Browse files

Merge pull request #18 from docker/socat

Socat
  • Loading branch information
Jim Van Fleet
Jim Van Fleet committed Oct 18, 2016
2 parents f651e7f + 494d9c5 commit 348292935cf34f886a0d2c0d2592e9e4546514c9
Showing with 22 additions and 1 deletion.
  1. +2 −1 Jenkinsfile
  2. +3 −0 haproxy/Dockerfile
  3. +1 −0 haproxy/conf/haproxy.cfg
  4. +2 −0 haproxy/container_files/bin/haproxycfg.sh
  5. +14 −0 tests/haproxy.bats
@@ -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');
@@ -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');
@@ -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
@@ -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
@@ -0,0 +1,2 @@
#!/bin/bash
echo "$@" | socat unix-connect:/usr/local/etc/haproxysock stdio
@@ -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.
You can’t perform that action at this time.