FROM alpine:3.6

###
### -- This is the RUNTIME docker container.  This next part was copied from devtools'
###    alpine container which we don't have access to pull in our account.
###

# we install glibc from https://github.com/sgerrand/alpine-pkg-glibc because it is required
# for go binaries.  The error you will get if you don't have glibc installed is "no such file"
# even though the file definitely exists.
RUN apk --no-cache add ca-certificates openssl wget && \
        update-ca-certificates && \
        wget --no-verbose -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
        wget  --no-verbose https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk && \
	    apk del wget && \
        apk add glibc-2.28-r0.apk && \
        rm -f glibc-2.28-r0.apk /etc/apk/keys/sgerrand.rsa.pub

# This is the runtime container, the build container is described in the Jenkinsfile

RUN mkdir -p /dx/bin/
ADD . /dx/bin/
WORKDIR /dx/bin/

CMD ["./discovery"]
