mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
simplify prod stage, move version label to action
This commit is contained in:
parent
207d863edf
commit
183007d120
19
Dockerfile
19
Dockerfile
@ -2,7 +2,7 @@ FROM golang:1.17 as builder
|
||||
|
||||
WORKDIR /go/src/mikefarah/yq
|
||||
|
||||
COPY . /go/src/mikefarah/yq
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 go build .
|
||||
# RUN ./scripts/test.sh -- this too often times out in the github pipeline.
|
||||
@ -11,20 +11,15 @@ 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
|
||||
FROM alpine:3 as production
|
||||
|
||||
RUN mkdir /home/yq/
|
||||
RUN addgroup -g 1000 yq && \
|
||||
adduser -u 1000 -G yq -s /bin/bash -h /home/yq -D yq
|
||||
RUN chown -R yq:yq /home/yq/
|
||||
LABEL maintainer="Mike Farah <mikefarah@users.noreply.github.com>"
|
||||
|
||||
COPY --from=builder /go/src/mikefarah/yq/yq /usr/bin/yq
|
||||
RUN chmod +x /usr/bin/yq
|
||||
|
||||
ARG VERSION=none
|
||||
LABEL version=${VERSION}
|
||||
|
||||
USER yq
|
||||
|
||||
WORKDIR /workdir
|
||||
|
||||
RUN set -eux; \
|
||||
addgroup -g 1000 yq; \
|
||||
adduser -u 1000 -G yq -s /bin/sh -h /home/yq -D yq
|
||||
USER yq
|
||||
|
||||
ENTRYPOINT ["/usr/bin/yq"]
|
||||
|
Loading…
Reference in New Issue
Block a user