This installs minimalist Pipe Viewer.
./install-pv.sh
| /artifacts/ |
| FROM alpine:3.23.4 as pv-build | |
| ARG PV_VER=1.10.5 | |
| ARG TB="https://ivarch.com/s/pv-$PV_VER.tar.gz" | |
| RUN until \ | |
| wget --no-verbose --output-document=- $TB \ | |
| |tar -xzf- \ | |
| ; do sleep 1 ; done | |
| RUN apk add --no-cache \ | |
| gcc \ | |
| make \ | |
| musl-dev \ | |
| && : | |
| WORKDIR /pv-$PV_VER | |
| RUN ./configure --enable-static \ | |
| && \ | |
| make -j \ | |
| && \ | |
| make install | |
| FROM scratch AS pv-artifacts | |
| COPY --from=pv-build /usr/local / |
| #! /usr/bin/env bash | |
| # | |
| # build static pv in a docker container & install in user home | |
| # | |
| set -e | |
| set -u | |
| set -x | |
| main() { | |
| if ! hash docker | |
| then | |
| "ERROR: Need docker to build." | |
| exit 1 | |
| fi >&2 | |
| docker buildx build --progress=plain --tag build-pv \ | |
| --output type=local,dest=./artifacts \ | |
| . | |
| cp --force --archive --link artifacts/bin/pv ~/bin/ | |
| } | |
| main | |
| exit |