From 927c29498f63c737f9ebcd5cb44d5e5e06e431b2 Mon Sep 17 00:00:00 2001 From: 030 Date: Tue, 7 May 2019 10:28:55 +0200 Subject: [PATCH 1/3] [GH-36] removed superfluous dependency paragraph as go-modules is used --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 165571c..a2ac35c 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,4 @@ returns: ``` 63.0.1 -``` - -## Dependencies - -``` -go get github.com/spf13/viper -``` +``` \ No newline at end of file From a507a5b151f701248fd9811f37ed88d11b36b9d2 Mon Sep 17 00:00:00 2001 From: 030 Date: Tue, 7 May 2019 11:51:22 +0200 Subject: [PATCH 2/3] [GH-36] paragraphs will start with lowercase --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a2ac35c..76002bb 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ Golang version of [yq](https://github.com/kislyuk/yq) -## Rationale +## rationale go-yq was created to prevent that pip has to be installed in order to install yq -## Usage +## usage ### help From 2486ea6fd8cd656b0551c68926dc968d6fd4a404 Mon Sep 17 00:00:00 2001 From: 030 Date: Mon, 13 May 2019 14:26:27 +0200 Subject: [PATCH 3/3] [GH-36] docker --- Dockerfile | 16 ++++++++++++++++ README.md | 14 +++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7e7b9fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:1.12.4-alpine as builder +COPY main.go go.mod go.sum ./go-yq/ +WORKDIR go-yq +RUN adduser -D -g '' go-yq && \ + apk add git && \ + CGO_ENABLED=0 go build && \ + cp go-yq /go-yq && \ + chmod 100 /go-yq + +FROM scratch +COPY --from=builder /etc/group /etc/group +COPY --from=builder /etc/passwd /etc/passwd +COPY --from=builder --chown=go-yq:go-yq /go-yq /usr/local/go-yq +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +USER go-yq +ENTRYPOINT ["/usr/local/go-yq"] diff --git a/README.md b/README.md index 6624935..7ac134d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ go-yq was created to prevent that pip has to be installed in order to install yq exit status 1 ``` -### example +### examples ``` [user@localhost go-yq]$ ./go-yq go run main.go .firefox_version ~/dev/ansible-firefox/defaults/main.yml @@ -43,8 +43,16 @@ returns: 63.0.1 ``` -## Dependencies +[![dockeri.co](https://dockeri.co/image/utrecht/go-yq)](https://hub.docker.com/r/utrecht/go-yq) ``` -go get github.com/spf13/viper +docker run -v /home/ben/dev/ansible-firefox:/ansible-firefox \ + -it utrecht/go-yq:2.1.0 .firefox_version \ + /ansible-firefox/defaults/main.yml +``` + +returns: + +``` +66.0.3 ```