Modify DockerFile for non-Linux users (#25)

Signed-off-by: soniasingla <soniasingla.1812@gmail.com>
This commit is contained in:
Sonia Singla 2020-08-24 16:02:54 +05:30 committed by GitHub
parent 1b40f56ce2
commit 687d9c535c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 4 deletions

View File

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