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

Merge pull request #962 from AndrianBdn/main

Add Docker usage instructions for croc tool
This commit is contained in:
Zack 2025-09-24 20:34:15 -07:00 committed by GitHub
commit 6a9fae4211
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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