ripgrep-all + fzf in a container
1.2K
uses ripgrep-all + fzf to search inside all sorts of files
uses the example rga-fzf() function from the github repo, with a small change:
if [[ -z "$RG_PREFIX" ]]; then
RG_PREFIX="rga --files-with-matches --smart-case"
else
RG_PREFIX="$RG_PREFIX"
fi
--smart-case to the default optionsRG_PREFIX environment variable to the containernote: any options that don't belong to ripgrep-all are passed to ripgrep
see https://github.com/phiresky/ripgrep-all
see my hound repo for code search for all my git repos
mount the host volume you want to search to /app, e.g.:
docker run \
--name ripgrep-all_fzf \
--rm \
-it \
-v <HOST_DIR>:/app \
-v ripgrep-all-fzf:/root/.cache/rga \
aaronkelly/ripgrep-all-fzf
The cache for text extraction is by default located at ~/.cache/rga, store it in a docker volume
nobody has a docker image for ripgrep-all because ... it's a bit tricky to build?
also I want to use this image at work
because of the many dependencies needed to make ripgrep-all, there's a lot of good things in this image:
This is how this image is built:
FROM alpine:edge
ARG RGA_BINARY=https://github.com/phiresky/ripgrep-all/releases/download/v0.9.6/ripgrep_all-v0.9.6-x86_64-unknown-linux-musl.tar.gz
# this forces alpine/ash to read a user profile file containing the rga-fzf alias
# ENV ENV="/root/.profile"
WORKDIR /app
RUN apk add \
curl \
ffmpeg \
fzf \
poppler-utils \
ripgrep && \
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing pandoc && \
curl -LO $RGA_BINARY && \
tar -xvf "$(basename $RGA_BINARY)" && \
cp ripgrep_all*/rga* /usr/local/bin
COPY rga_fzf /usr/local/bin/
ENTRYPOINT rga_fzf
If you want to support the maintenance of this image, my contact details are on my blog: https://aaronpkelly.github.io/
Content type
Image
Digest
sha256:374a97f17…
Size
105 MB
Last updated
over 3 years ago
docker pull aaronkelly/ripgrep-all-fzf