yq/Dockerfile

29 lines
709 B
Docker
Raw Normal View History

FROM golang:1.20.5 as builder
WORKDIR /go/src/mikefarah/yq
COPY . .
2023-03-16 02:36:51 +00:00
RUN CGO_ENABLED=0 go build -ldflags "-s -w" .
2021-10-30 03:08:13 +00:00
# RUN ./scripts/test.sh -- this too often times out in the github pipeline.
RUN ./scripts/acceptance.sh
# Choose alpine as a base image to make this useful for CI, as many
# CI tools expect an interactive shell inside the container
2021-10-19 23:58:54 +00:00
FROM alpine:3 as production
LABEL maintainer="Mike Farah <mikefarah@users.noreply.github.com>"
COPY --from=builder /go/src/mikefarah/yq/yq /usr/bin/yq
WORKDIR /workdir
2018-10-25 06:49:46 +00:00
RUN set -eux; \
addgroup -g 1000 yq; \
adduser -u 1000 -G yq -s /bin/sh -h /home/yq -D yq
2021-12-02 09:06:14 +00:00
RUN chown -R yq:yq /workdir
USER yq
2020-11-20 02:53:44 +00:00
ENTRYPOINT ["/usr/bin/yq"]