FROM golang:1.13-alpine as build
WORKDIR /go/src/code.justin.tv/devhub/e2ml-loadtest
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .


FROM alpine:latest as run
LABEL maintainer="Mario Izquierdo <marioiz@twitch.tv>"
WORKDIR /eml-loadtest
# Allow using https with tsl
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
# Copy the pre-built binary file from the previous stage
COPY --from=build /go/src/code.justin.tv/devhub/e2ml-loadtest/main .
ENTRYPOINT ["./main"]
