From 084cb6630c24d773ddc120748dd1c824fea0e6d8 Mon Sep 17 00:00:00 2001 From: Andrian Budantsov Date: Thu, 4 Sep 2025 18:35:38 +0400 Subject: [PATCH] Add Docker usage instructions for croc tool --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index b27725da..14985255 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,16 @@ Or install into a particular environment with [`conda`](https://docs.conda.io/pr conda install --channel conda-forge croc ``` +### On Linux, macOS via Docker + +Add the following one-liner function to your ~/.profile (works with any POSIX-compliant shell): + +```bash +croc() { [ $# -eq 0 ] && set -- ""; docker run --rm -it --user "$(id -u):$(id -g)" -v "$(pwd):/c" -v "$HOME/.config/croc:/.config/croc" -w /c -e CROC_SECRET schollz/croc "$@"; } +``` + +You can also just paste it in the terminal for current session. On first run Docker will pull the image. `croc` via Docker will only work within the current directory and its subdirectories. + ### Build from Source If you prefer, you can [install Go](https://go.dev/dl/) and build from source (requires Go 1.22+):