Skip to content

Install fzf from GitHub releases instead of apt #14

@dguido

Description

@dguido

Problem

The Dockerfile installs fzf from Ubuntu 24.04 apt (fzf package = v0.44.1), then separately downloads the shell integration scripts from the fzf GitHub repo:

RUN apt-get install -y ... fzf ...

ARG FZF_VERSION=0.44.1
RUN mkdir -p /home/vscode/.fzf && \
  curl -fsSL "https://raw.githubusercontent.com/junegunn/fzf/${FZF_VERSION}/shell/key-bindings.zsh" -o /home/vscode/.fzf/key-bindings.zsh && \
  curl -fsSL "https://raw.githubusercontent.com/junegunn/fzf/${FZF_VERSION}/shell/completion.zsh" -o /home/vscode/.fzf/completion.zsh

This has two issues:

  1. fzf 0.44.1 is old — the current release is 0.67.0 with significant improvements
  2. Downloading shell scripts separately is fragile — fzf 0.48+ has built-in fzf --zsh that generates shell integration natively, making the separate downloads unnecessary

Proposed fix

Remove fzf from the apt install list and install the binary from GitHub releases:

ARG FZF_VERSION=0.67.0
RUN ARCH=$(dpkg --print-architecture) && \
  case "${ARCH}" in \
    amd64) FZF_ARCH="linux_amd64" ;; \
    arm64) FZF_ARCH="linux_arm64" ;; \
    *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \
  esac && \
  curl -fsSL "https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-${FZF_ARCH}.tar.gz" | tar -xz -C /usr/local/bin

Then in .zshrc, replace the manual sourcing:

# Before
source ~/.fzf/key-bindings.zsh
source ~/.fzf/completion.zsh

# After
eval "$(fzf --zsh)"

This is already how the trailofbits/skills devcontainer-setup plugin does it (per @DarkaMaul's review feedback on trailofbits/skills#26).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions