Sign inSign up

aaronkelly/ripgrep-all-fzf

By aaronkelly

•Updated over 3 years ago

ripgrep-all + fzf in a container

Image
1

1.2K

aaronkelly/ripgrep-all-fzf repository overview

⁠about

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
  • it adds --smart-case to the default options
  • you can override the default options that are passed to ripgrep-all/ripgrep by passing a RG_PREFIX environment variable to the container

note: 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

⁠getting started

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

⁠why i created this image

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:

  • ffmpeg
  • fzf
  • ripgrep
  • ripgrep-all
  • pandoc
  • poppler utils

⁠dockerfile

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

⁠contact

If you want to support the maintenance of this image, my contact details are on my blog: https://aaronpkelly.github.io/⁠

Tag summary

Content type

Image

Digest

sha256:374a97f17…

Size

105 MB

Last updated

over 3 years ago

docker pull aaronkelly/ripgrep-all-fzf