1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-10 21:01:02 +02:00

Add Docker usage instructions for croc tool

This commit is contained in:
Andrian Budantsov 2025-09-04 18:35:38 +04:00 committed by GitHub
parent cdd4d3aca4
commit 084cb6630c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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+):