Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #38 from 030/gh36-docker
Browse files Browse the repository at this point in the history
[GH-36] removed superfluous dependency paragraph as go-modules is used
  • Loading branch information
030 authored May 13, 2019
2 parents ce3089c + 23426ce commit f46dece
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

jq-style golang equivalent of [yq](https://github.com/kislyuk/yq). [Another yq tool that is written in golang](https://github.com/mikefarah/yq) could be used if one requires more features.

## Rationale
## rationale

go-yq was created to prevent that pip has to be installed in order to install yq

## Usage
## usage

### help

Expand All @@ -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
Expand All @@ -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
```

0 comments on commit f46dece

Please sign in to comment.