The installation instructions for Linux assume Ubuntu, but some users may want to use yq on things like Alpine which don't have snap, apt, or go. What would be the best installation process for gettin yq working while also minimizing dependencies/size?
wget -O /usr/local/bin/yaml "https://github.com/mikefarah/yq/releases/download/${YAML_BIN_VERSION}/yq_linux_amd64"
That is what I use in all of my Dockerfiles based on alpine.
Any chance of getting it added to the official apk packages at https://pkgs.alpinelinux.org/ so we can just do apk add yq ?
That'd be really cool - I personally don't have the time at the moment to investigate though
I personally don't have the time at the moment to investigate though
The instructions are here . It isn't too bad, I just am in the same boat as you. :-)
I image you would just have a make alpine or make apk target in your Makefile , just like you have make snap .
How do you actually call make snap, since it isn't in the Travis .travis.yml as far as I can tell? Similar question for homebrew and others?
+1 here for integrated apk support.
+1
+1
Hmm. Just stumbled on this one cause i need it. I might take on it this weekend.
@mikefarah any Contributor notes/guide/etc somewhere ? didn't find any yet
--- EDIT: it's in the readme :)), sorry !
I would like to see this feature as apk add yq
wget $(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4) -O /usr/bin/yq
chmod +x /usr/bin/yq
I've been using this command to download the latest version to my alpine containers. Would be nice to have it in apk, but this is fine as a workaround
Change the grep linux_amd64 if you need a different type
If you also have jq on your Alpine image, you can install the latest version of yq with:
wget -q -O /usr/bin/yq $(wget -q -O - https://api.github.com/repos/mikefarah/yq/releases/latest | jq -r '.assets[] | select(.name == "yq_linux_amd64") | .browser_download_url')
chmod +x /usr/bin/yq
as of 2020-08-01 yq is now in Edge/Testing, when moved to community/ it will be available once 3.13 is released
apk add py-pip; pip install yq
Nah that's for a different the python implementation of yq that wraps jq. This yq is has native binaries
apk add py-pip; pip install yq
Nah that's for a different the python implementation of yq that wraps jq. This yq is has native binaries
yeah agree with you. found out the hard way :(
The instructions are:
$MIRROR/alpine/v$VERSION/community to /etc/apk/repositoriesapk updateyq with apk add yq Wow that's awesome! This seems like something I should put on the Github README.md.
What's the process for updating that when I release a new version of yq?
When upstream (you in this case) releases a new version an Alpine Linux contributor has to update the APKBUILD in Alpine Linux's aports which makes the builders build the new version and upload it.
for the end-user just:
apk updateapk upgradein EDGE we (Alpine Linux) always track the latest upstream, or latest stable branch which will make way into a stable Alpine Linux release.
Awesome - are you happy to volunteer to keep the Alpine build up to date when new releases are made? I'll raise a github issue for Alpine like https://github.com/mikefarah/yq/issues/533
APKBUILDs have a Maintainer: to denote the one responsible for the package.
The current maintainer is Tuan Hoang <[email protected]>
Ace - cheers.
To add it from the edge community repo
echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk update
apk add yq --no-cache
Mixing EDGE and versioned repositories is not supported, although there is a high chance of it working because yq only uses the libc.
Would this be the best way to add?
apk add yq --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
use FROM alpine:edge to avoid mixing distro versions
Most helpful comment
+1 here for integrated apk support.