general

Why can't my Docker container find the local git repository directory for code completion setup?

I'm trying to set up the Repository context for code completion using local repositories, but I'm encountering an issue where the Docker container can't seem to find my local directory. Here's my config.toml setup:

[[repositories]]
name = "workrepo"
git_url = "file:///home/Users/{user}/OneDrive/Work/Snippets"

And the error message I'm getting:

# tabby scheduler --now
Syncing 1 repositories...
thread 'main' panicked at crates/tabby-scheduler/src/repository.rs:70:17:
Directory /home/Users/{user}/OneDrive/Work/Snippets does not exist
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The repository does exist at C:\Users\{user}\OneDrive\Work\Snippets and contains a .git folder. I've tried various path formats but none seem to work. Am I doing anything obviously wrong?

Za

Zach Rumancik

Asked on May 09, 2024

The issue is most likely due to the Docker container not having access to the folders where the local repositories are stored. To resolve this, you should either run the executable locally without using Docker or configure the Docker container to have access to the local directory where the repository is located. This can be done by mounting the local directory to the Docker container using the -v or --volume option when running the container. For example:

docker run -it --gpus all -p 8080:8080 -v /path/to/local/repo:/path/inside/container tabbyml/tabby serve --model CodeQwen-7B --device cuda

Make sure to replace /path/to/local/repo with the actual path to your local repository and /path/inside/container with the path that the Docker container should use to access the repository.

May 10, 2024Edited by