2018-04-01 09:48:06 +00:00
|
|
|
FROM golang:1.9 as builder
|
|
|
|
|
|
|
|
WORKDIR /go/src/mikefarah/yq
|
|
|
|
|
2018-06-27 02:05:52 +00:00
|
|
|
# cache devtools
|
|
|
|
COPY ./scripts/devtools.sh /go/src/mikefarah/yq/scripts/devtools.sh
|
|
|
|
RUN ./scripts/devtools.sh
|
|
|
|
|
|
|
|
# cache vendor
|
|
|
|
COPY ./vendor/vendor.json /go/src/mikefarah/yq/vendor/vendor.json
|
|
|
|
RUN govendor sync
|
|
|
|
|
2018-04-01 09:48:06 +00:00
|
|
|
COPY . /go/src/mikefarah/yq
|
|
|
|
|
2018-04-02 23:45:30 +00:00
|
|
|
RUN CGO_ENABLED=0 make local build
|
2018-04-01 09:48:06 +00:00
|
|
|
|
|
|
|
# Choose alpine as a base image to make this useful for CI, as many
|
|
|
|
# CI tools expect an interactive shell inside the container
|
2018-10-25 06:49:46 +00:00
|
|
|
FROM alpine:3.7 as production
|
2018-04-01 09:48:06 +00:00
|
|
|
|
|
|
|
COPY --from=builder /go/src/mikefarah/yq/yq /usr/bin/yq
|
|
|
|
RUN chmod +x /usr/bin/yq
|
|
|
|
|
2018-10-25 06:49:46 +00:00
|
|
|
ARG VERSION=none
|
|
|
|
LABEL version=${VERSION}
|
|
|
|
|
2018-04-01 09:48:06 +00:00
|
|
|
WORKDIR /workdir
|