[GH-ISSUE #210] Docker compose issues #129

Closed
opened 2026-10-15 18:04:43 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @rigbyb on GitHub (Dec 24, 2023).
Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/210

There were some issues during the docker container setup on my machine that I managed to circumvent, so I'm posting some details here.

System Info

  • Ubuntu 23.10 Server
  • Docker version 24.0.7, build afdd53b

docker-compose.yml

parsing ~/Docker/sillytavern-github/SillyTavern-Extras/docker/docker-compose.yml: yaml: line 2: did not find expected key

docker compose up seems to fail due to indentation. Despite the message, this was caused by line 5 (deploy:):

1 version: "3"
2 services: 
3   sillytavern-extras:
4 #    runtime: nvidia
5      deploy:
6       resources:
7         reservations:

This was fixed by removing the single extra space before "deploy:".

version: "3"
services:
  sillytavern-extras:
#    runtime: nvidia
    deploy:
      resources:
        reservations:

Another issue came from mounting api_key.txt.

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "~/Docker/sillytavern-github/SillyTavern-Extras/docker/api_key.txt" to rootfs at "/sillytavern-extras/api_key.txt": mount ~/Docker/sillytavern-github/SillyTavern-Extras/docker/api_key.txt:/sillytavern-extras/api_key.txt (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

The mount location for api_key.txt assumes the current directory (line 26):

 23     volumes:
 24       #- "./chromadb:/chromadb"
 25       - "./cache:/root/.cache"
 26       - "./api_key.txt:/sillytavern-extras/api_key.txt:rw"

Based off the cloned repo, api_key.txt is located in the parent directory, and thus should be:

    volumes:
      #- "./chromadb:/chromadb"
      - "./cache:/root/.cache"
      - "../api_key.txt:/sillytavern-extras/api_key.txt:rw"

Dockerfile

The Dockerfile build process gets stuck at stage 8/11 (conda install) due to the confirmation "([y]/n)?" dialogue.

=> => # Proceed ([y]/n)?

Adding -y to the conda install step on line 26 seems to solve this issue.
RUN conda install -y pytorch torchvision torchaudio pytorch-cuda=11.7 git -c pytorch -c nvidia -c conda-forge

Originally created by @rigbyb on GitHub (Dec 24, 2023). Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/210 There were some issues during the docker container setup on my machine that I managed to circumvent, so I'm posting some details here. # System Info - Ubuntu 23.10 Server - Docker version 24.0.7, build afdd53b # docker-compose.yml > parsing ~/Docker/sillytavern-github/SillyTavern-Extras/docker/docker-compose.yml: yaml: line 2: did not find expected key `docker compose up` seems to fail due to indentation. Despite the message, this was caused by line 5 (deploy:): ``` 1 version: "3" 2 services: 3 sillytavern-extras: 4 # runtime: nvidia 5 deploy: 6 resources: 7 reservations: ``` This was fixed by removing the single extra space before "deploy:". ``` version: "3" services: sillytavern-extras: # runtime: nvidia deploy: resources: reservations: ``` Another issue came from mounting `api_key.txt`. > Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "~/Docker/sillytavern-github/SillyTavern-Extras/docker/api_key.txt" to rootfs at "/sillytavern-extras/api_key.txt": mount ~/Docker/sillytavern-github/SillyTavern-Extras/docker/api_key.txt:/sillytavern-extras/api_key.txt (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type The mount location for `api_key.txt` assumes the current directory (line 26): ``` 23 volumes: 24 #- "./chromadb:/chromadb" 25 - "./cache:/root/.cache" 26 - "./api_key.txt:/sillytavern-extras/api_key.txt:rw" ``` Based off the cloned repo, `api_key.txt` is located in the parent directory, and thus should be: ``` volumes: #- "./chromadb:/chromadb" - "./cache:/root/.cache" - "../api_key.txt:/sillytavern-extras/api_key.txt:rw" ``` # Dockerfile The Dockerfile build process gets stuck at stage 8/11 (conda install) due to the confirmation "([y]/n)?" dialogue. > => => # Proceed ([y]/n)? Adding `-y` to the conda install step on line 26 seems to solve this issue. `RUN conda install -y pytorch torchvision torchaudio pytorch-cuda=11.7 git -c pytorch -c nvidia -c conda-forge`
Author
Owner

@rigbyb commented on GitHub (Dec 24, 2023):

These changes seemed to have solved my issues, and so hopefully will apply to others (without causing anything to break). I can also add these changes to a commit, if necessary (and possible).

<!-- gh-comment-id:1868584772 --> @rigbyb commented on GitHub (Dec 24, 2023): These changes seemed to have solved my issues, and so hopefully will apply to others (without causing anything to break). I can also add these changes to a commit, if necessary (and possible).
Author
Owner

@Cohee1207 commented on GitHub (Dec 24, 2023):

I tried to fix, but idk if it worked. I never tried running it with Docker

<!-- gh-comment-id:1868585468 --> @Cohee1207 commented on GitHub (Dec 24, 2023): I tried to fix, but idk if it worked. I never tried running it with Docker
Author
Owner

@rigbyb commented on GitHub (Dec 24, 2023):

It's okay. The updates seem to have fixed the issues I mentioned. Thanks :)

<!-- gh-comment-id:1868589340 --> @rigbyb commented on GitHub (Dec 24, 2023): It's okay. The updates seem to have fixed the issues I mentioned. Thanks :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SillyTavern/SillyTavern-Extras#129
No description provided.