summaryrefslogtreecommitdiffstats
path: root/mock-sdc/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'mock-sdc/Dockerfile')
-rw-r--r--mock-sdc/Dockerfile33
1 files changed, 33 insertions, 0 deletions
diff --git a/mock-sdc/Dockerfile b/mock-sdc/Dockerfile
new file mode 100644
index 0000000..524c178
--- /dev/null
+++ b/mock-sdc/Dockerfile
@@ -0,0 +1,33 @@
+FROM golang:alpine AS builder
+
+# Add all the source code (except what's ignored
+# under `.dockerignore`) to the build context.
+ADD ./ /go/src/
+
+WORKDIR /go/src
+
+RUN apk add --no-cache git
+RUN go env -w GO111MODULE=auto
+RUN go get github.com/satori/go.uuid
+RUN go get github.com/labstack/echo
+RUN go get github.com/golang-jwt/jwt
+RUN go get golang.org/x/time/rate
+
+RUN set -ex && \
+ CGO_ENABLED=0 GOOS=linux go build \
+ -tags netgo \
+ -installsuffix cgo \
+ -v -a \
+ -ldflags '-extldflags "-static"' \
+ -o mock-sdc .
+
+RUN ls -la
+
+FROM scratch
+
+# Retrieve the binary from the previous stage
+COPY --from=builder /go/src/mock-sdc /app/mock-sdc
+WORKDIR /app
+
+# Set the binary as the entrypoint of the container
+ENTRYPOINT [ "./mock-sdc" ]