-
Hi, So as you know, I'm trying to setup ktra in our workplace and I've chosen the Docker way. Our Docker guy told me I need to setup a compose file so we'll have the persistent binding volume to store ktra's data. Currently, the file looks like this: version: "3.9"
services:
ktra:
image: ghcr.io/moriturus/ktra:0.5.0
configs:
- source: ktra_cfg
target: /ktra.toml
volumes:
- type: bind
source: ./drive/crates
target: /crates
- type: bind
source: ./drive/crates_io_caches
target: /crates_io_caches
- type: bind
source: ./drive/db
target: /db
- type: bind
source: ./drive/index
target: /index
configs:
ktra_cfg:
file: ./ktra.toml in the ktra.toml, there's only when running
my What am I doing wrong here? Another thing is that I've seen that if a wrong config file path is given, you just use a default configuration. I think it would be better to reject the execution with a proper error message :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hello @Geobert . First of all, Secondly, and as far as I know, Based on the above, I've tried writing a version: "3.9"
services:
ktra:
image: ghcr.io/moriturus/ktra:0.5.0
environment:
- RUST_LOG=ktra,warp=debug
command:
- "--dl-dir-path=/data/crates"
- "--cache-dir-path=/data/crates_io_caches"
- "--db-dir-path=/data/db"
- "--local-path=/data/index"
volumes:
- ./ktra.toml:/ktra.toml
- type: bind
source: ./drive
target: /data I can run the container without error messages using this settings. I really appreciate your practical using of |
Beta Was this translation helpful? Give feedback.
Hello @Geobert .
First of all,
ktra
checks that the local index repository directory does exist or not.If the directory exists
ktra
treats it as a cloned-repository then try to pull and merge the latest index from the remote repository. Otherwisektra
is going to create a new directory.So you should not create an empty directory and the error message you have shown is caused by it.
Secondly, and as far as I know,
configs
settings in thedocker-compose.yml
won't be working unless you use the docker swarm mode.I think the most simple way to mount your
ktra.toml
file to a container is usingvolumes
feature.Based on the above, I've tried writing a
docker-compose.yml
file: