Skip to content

Commit 687d9c5

Browse files
authored
Modify DockerFile for non-Linux users (#25)
Signed-off-by: soniasingla <[email protected]>
1 parent 1b40f56 commit 687d9c5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Dockerfile

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
FROM golang:1.14.2-alpine3.11 as builder
2+
WORKDIR $GOPATH/src/github.com/thanos-io/thanosbench
3+
# Change in the docker context invalidates the cache so to leverage docker
4+
# layer caching, moving update and installing apk packages above COPY cmd
5+
# More info https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache
6+
RUN apk update && apk upgrade && apk add --no-cache alpine-sdk
7+
# Replaced ADD with COPY as add is generally to download content form link or tar files
8+
# while COPY supports the basic copying of local files into the container.
9+
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy
10+
COPY . $GOPATH/src/github.com/thanos-io/thanosbench
11+
RUN git update-index --refresh; make build
12+
# -----------------------------------------------------------------------------
113
FROM quay.io/prometheus/busybox:latest
214
LABEL maintainer="The Thanos Authors"
3-
4-
COPY thanosbench /bin/thanosbench
5-
6-
ENTRYPOINT [ "/bin/thanosbench" ]
15+
COPY --from=builder /go/src/github.com/thanos-io/thanosbench/thanosbench /bin/thanosbench
16+
ENTRYPOINT [ "/bin/thanosbench" ]

0 commit comments

Comments
 (0)