#community-help

Running Typesense in Docker Container on Windows 10

TLDR Christian had issues running Typesense in Docker due to an unrecognized data directory. Jason suggested a solution to fix the file path issue, which Christian successfully implemented using Windows Powershell.

Powered by Struct AI
12
13mo
Solved
Join the chat
Oct 28, 2022 (14 months ago)
Christian
Photo of md5-8ac455f6d302407f03def4c775778b28
Christian
03:04 PM
Hi, I'm having trouble running Typesense in a Docker container (Docker Desktop running on Windows 10). It is telling me that the data directory does not exist (even though it does), when attempting to run from a bash terminal. Any suggestions?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:19 PM
You’d need to mount the data directory from your host machine into the Docker container
03:19
Jason
03:19 PM
Could you share the Docker run command you’re using?
Christian
Photo of md5-8ac455f6d302407f03def4c775778b28
Christian
03:46 PM
sure thing -- I've tried this way:
03:47
Christian
03:47 PM
$ docker run -p 8108:8108 -v $(pwd)/typesense-data:/data typesense/typesense:0.23.1 --data-dir=/data --api-key=$TYPESENSE_API_KEY --enable-cors
I20221028 14:53:03.157213     1 typesense_server_utils.cpp:352] Starting Typesense 0.23.1
I20221028 14:53:03.157263     1 typesense_server_utils.cpp:355] Typesense is using jemalloc.
E20221028 14:53:03.157555     1 typesense_server_utils.cpp:373] Typesense failed to start. Data directory C:/Program Files/Git/data does not exist.
03:47
Christian
03:47 PM
and this way:
03:47
Christian
03:47 PM
$ docker run -p 8108:8108 -v $(pwd)/typesense-data:/data typesense/typesense:0.23.1 --data-dir=$TYPESENSE_DATA_DIR --api-key=$TYPESENSE_API_KEY --enable-cors
I20221028 14:53:03.157213     1 typesense_server_utils.cpp:352] Starting Typesense 0.23.1
I20221028 14:53:03.157263     1 typesense_server_utils.cpp:355] Typesense is using jemalloc.
E20221028 14:53:03.157555     1 typesense_server_utils.cpp:373] Typesense failed to start. Data directory C:/source/typesense-data does not exist.
03:48
Christian
03:48 PM
the data mount does not seem to be recognized correctly
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:12 PM
Looks like in windows the direction of the slash might cause issues. Could you try one of the solutions here and let me know which one works for you: https://stackoverflow.com/questions/35315996/how-do-i-mount-a-docker-volume-while-using-a-windows-host

I’d love to update our docs based on that
Nov 09, 2022 (13 months ago)
Christian
Photo of md5-8ac455f6d302407f03def4c775778b28
Christian
08:42 PM
I was unable to get this working in Bash but was successful in Windows Powershell:docker run -p 8108:8108 -v $PWD/typesense-data:/data typesense/typesense:0.23.1 --data-dir=/data --api-key=$TYPESENSE_API_KEY --enable-cors
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:43 PM
Oh interesting, I would have expected that to be opposite!
Christian
Photo of md5-8ac455f6d302407f03def4c775778b28
Christian
08:43 PM
Same! Bash did not like the data volume mount for whatever reason

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3005 threads (79% resolved)

Join Our Community

Similar Threads

Troubleshooting Typesense Server Error on Docker

vikram was facing an error with Typesense Server Docker container and loss of data on restart. Kishore Nallan guided to avoid mounting tmp directory from localhost and explained stopping the Docker container.

2

16
14mo
Solved

Deploying Typesense in GCP Cloud Run

Christian had difficulties obtaining an API key for deploying Typesense in GCP Cloud Run. Kishore Nallan guided on API key creation when setting up Typesense server and suggested checking the Typesense self-hosting guide. Christian decided to run the Typesense in Kubernetes instead of Cloud Run. Nasim thanked Christian for sharing findings.

1

20
19mo

"Resolving Startup Issue with Typesense Single Replica Set in Local `K8s` Setup"

Vishal encountered issues starting a Typesense single replica set due to directory permission issues. Kishore Nallan suggested checking if the volume was accessible for writes. Vishal resolved the problem by adjusting permissions on the host.

2

10
22mo
Solved

Trouble with Typesense Memory Usage when Restarting Docker Container

Blend reports increased memory usage when restarting Docker with Typesense, information shared with Jason and Kishore Nallan. Potential data edge case identified as potential cause, although resolution undetermined.

9

45
12mo

Troubleshooting Typesense Server Start-Up Process with Docker

gun asked how to start the Typesense server using Docker, which Jason explained. Monk added it also works on Windows 10 without Docker and agreed to add these details to documentation.

2

6
25mo
Solved