mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 05:38:04 +00:00
Improved docker build process
This commit is contained in:
parent
90fe9c6512
commit
785ee68a76
@ -16,9 +16,12 @@ RUN CGO_ENABLED=0 make local build
|
|||||||
|
|
||||||
# Choose alpine as a base image to make this useful for CI, as many
|
# Choose alpine as a base image to make this useful for CI, as many
|
||||||
# CI tools expect an interactive shell inside the container
|
# CI tools expect an interactive shell inside the container
|
||||||
FROM alpine:3.7
|
FROM alpine:3.7 as production
|
||||||
|
|
||||||
COPY --from=builder /go/src/mikefarah/yq/yq /usr/bin/yq
|
COPY --from=builder /go/src/mikefarah/yq/yq /usr/bin/yq
|
||||||
RUN chmod +x /usr/bin/yq
|
RUN chmod +x /usr/bin/yq
|
||||||
|
|
||||||
|
ARG VERSION=none
|
||||||
|
LABEL version=${VERSION}
|
||||||
|
|
||||||
WORKDIR /workdir
|
WORKDIR /workdir
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
- docker
|
- docker
|
||||||
- build and push latest and new version tag
|
- build and push latest and new version tag
|
||||||
|
- docker build . --arg -t mikefarah/yq:latest -t mikefarah/yq:VERSION
|
||||||
|
|
||||||
- debian package
|
- debian package
|
||||||
- execute
|
- execute
|
||||||
|
9
scripts/publish-docker.sh
Executable file
9
scripts/publish-docker.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
VERSION="$(git describe --tags --abbrev=0)"
|
||||||
|
docker build \
|
||||||
|
--target production \
|
||||||
|
--build-arg VERSION=${VERSION} \
|
||||||
|
-t mikefarah/yq:latest \
|
||||||
|
-t mikefarah/yq:${VERSION} \
|
||||||
|
.
|
Loading…
Reference in New Issue
Block a user