Skip to content

Commit

Permalink
reworking docker testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Dec 14, 2019
1 parent cb13c83 commit abb27a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM golang:1.13-alpine3.10

COPY . /root

WORKDIR /root

RUN apk --no-cache add gcc && apk --no-cache add musl-dev && go test -v
14 changes: 9 additions & 5 deletions docker_test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -ex


SRCDIR=/root
Expand All @@ -9,17 +9,21 @@ hosts=$(cat ${DIR}/_testdata/insecurities.txt)

cd $DIR

GODEBUG=netdns=cgo go test -c -o intransporttest
LABEL="intransport_test"
docker rm -f ${LABEL} || true
docker rmi ${LABEL} || true

docker=$(which docker)

args=(run -t -v "${DIR}":"${SRCDIR}" -w "${SRCDIR}")
args=(build --label ${LABEL} -t ${LABEL})

for host in $hosts; do
args+=(--add-host ${host}:127.0.0.1)
done

args+=(ubuntu:trusty /bin/bash -c "${SRCDIR}/intransporttest")
## butt wait, there's more!
args+=( . )

exec "$docker" "${args[@]}"
#echo "${args[@]}"

docker run ${LABEL}

0 comments on commit abb27a0

Please sign in to comment.