forked from ghostunnel/ghostunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-test
37 lines (28 loc) · 1.26 KB
/
Dockerfile-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Dockerfile for running integration tests, includes PKCS11/SoftHSM setup.
#
# Build image:
# docker build --build-arg GO_VERSION=[VERSION] -t ghostunnel/ghostunnel-test -f Dockerfile-test .
#
# Run integration tests:
# docker run -v /dev/log:/dev/log -v $PWD:/go/src/github.com/ghostunnel/ghostunnel ghostunnel/ghostunnel-test
ARG GO_VERSION
FROM golang:${GO_VERSION}
# Install build dependencies
RUN apt-get update && \
apt-get install -y build-essential python3-minimal netcat-traditional softhsm2 rsyslog git python3-distutils </dev/null && \
mkdir -p /etc/softhsm /var/lib/softhsm/tokens /go/src/github.com/ghostunnel/ghostunnel && \
go install github.com/wadey/gocovmerge@latest && \
go install golang.org/x/tools/cmd/cover@latest
WORKDIR /go/src/github.com/ghostunnel/ghostunnel
ENV GO111MODULE=on
# Setup SoftHSM for testing PKCS11 support
# Instruct PKCS11 integration test to run
ENV GHOSTUNNEL_TEST_PKCS11=true
# Set params for PKCS11 module
ENV GHOSTUNNEL_TEST_PKCS11_MODULE=/usr/lib/softhsm/libsofthsm2.so
ENV GHOSTUNNEL_TEST_PKCS11_LABEL=ghostunnel-pkcs11-test
ENV GHOSTUNNEL_TEST_PKCS11_PIN=1234
# Set SoftHSM config file
ENV SOFTHSM2_CONF=/etc/softhsm/softhsm2.conf
ENTRYPOINT ["/usr/bin/make"]
CMD ["clean", "softhsm-import", "test"]