Docker & Tigrisfs - Tigris

Docker & Tigrisfs

Hello,

I set up tigrisfs locally, and now I’m trying to set it up in a Docker container on Render. However, I’m running into issues. I managed to get as far as here with a Dockerfile and start.sh:

FROM python:3.11-slim-bookworm

WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

RUN playwright install-deps
RUN playwright install

RUN apt-get update && \
    apt-get install -y automake autotools-dev g++ git libcurl4-gnutls-dev libfuse-dev && \
    apt-get install -y wget tar curl jq rclone s3fs mailcap fuse3 gvfs-fuse && \
    wget https://github.com/tigrisdata/tigrisfs/releases/download/v1.2.1/tigrisfs_1.2.1_linux_amd64.tar.gz -O /app/tigrisfs.tar.gz && \
    tar -xzf /app/tigrisfs.tar.gz && \
    apt-get clean

COPY . .

RUN mkdir -p /app/vol
#RUN /app/tigrisfs test /app/vol
RUN ls -lA /app # C
RUN chmod +x /app/start.sh
RUN chmod +x /app/tigrisfs

#ENTRYPOINT ["/app/tigrisfs"]
ENTRYPOINT ["/app/start.sh"]
#CMD ["timeout", "15m", "python3", "app.py"]
CMD ["test", "/app/vol"]
#!/bin/bash

# 1. Check if the mount directory exists and is a directory
if [ ! -d "$2" ]; then
    echo "Mount directory $2 does not exist."
    exit 1
fi

# 2. Start TigrisFS mount in the BACKGROUND (&)
# This uses the arguments passed to the script: $1 (bucket) and $2 (mount point)
echo "Starting TigrisFS mount for $1 at $2..."
/app/tigrisfs --debug --debug_fuse --debug_s3 "$1" "$2" &

# 4. Wait for the mount to stabilize (Optional but safer for FUSE)
sleep 5
ls
df -h

# 5. Start your main Python application in the FOREGROUND
# This command will block, keeping the container running.
echo "Mount established. Starting Python script..."
python /app/app.py

# 7. Exit with the Python script's exit code
exit $?

However, the bucket is still not mounting (as seen by the output of df -h), and app.py cannot read the text file. Does anyone know what I’m missing to make this work?

Solution

Hi,

Try to add -f to the tigrisfs mount command, so logs are dumped to the terminal; this would give more information why it’s not mounted.

My guess is that access keys are not set up in the container.

Reply

Hi, thanks for the reply. Sorry, I missed it until now. I added what you suggested and got this back which seems to suggest nothing is wrong, but it still isn’t mounting. The access keys are getting set up correctly.

{"level":"info","module":"","version":"1.2.1","time":1759714458,"caller":"/home/runner/work/tigrisfs/tigrisfs/main.go:126","message":"Starting TigrisFS version"}
{"level":"info","module":"","bucketName":"test","mountPoint":"/app/vol","time":1759714458,"caller":"/home/runner/work/tigrisfs/tigrisfs/main.go:127","message":"Mounting"}
{"level":"info","module":"","uid":0,"defaultGid":0,"time":1759714458,"caller":"/home/runner/work/tigrisfs/tigrisfs/main.go:128","message":"Default uid=gid"}
{"level":"info","module":"","time":1759714458,"caller":"/home/runner/work/tigrisfs/tigrisfs/core/cfg/conf_s3.go:129","message":"default endpoint = https://t3.storage.dev"}

Actually, it’s now working. All I needed to do was give it more time to mount, so I changed “sleep 5” to “sleep 30” and eventually to “sleep 10".