-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running LiteFS in Docker #223
Comments
@hananbnz From my understanding, FROM alpine
COPY --from=litefs /usr/local/bin/litefs /usr/local/bin/litefs
ADD litefs.yml /etc/litefs.yml
RUN apk add bash curl fuse sqlite
ENTRYPOINT litefs with this command: $ docker build -t litefs-docker-test .
$ docker run --device /dev/fuse --cap-add SYS_ADMIN litefs-docker-test The This comment on a different issue seems to indicate that you can use
In addition to capabilities required by vanilla SQLite (file read/write), LiteFS needs to be able to access
Maybe I'm misunderstanding but that seems similar to the previous question.
Yeah, the biggest limitation seems to be restricting FUSE within Docker. Otherwise, LiteFS doesn't need a lot from the OS. |
@benbjohnson Thanks for your answers.
Because I'm trying to minimize the permissions I give a container, I would like to make sure of the following - In other words, LiteFS should only need to access the Thanks |
Yeah, my understanding is that it gets a file descriptor for |
Hi,
I am new to LiteFS and I'm trying to run LiteFS with my Go app on Docker container.
To clarify, I’m not planning on using Fly.io for the near future.
Working on docker container with LiteFS raise some security concerns.
Below I describe my setup and my questions, thanks.
My base image is alpine and this is my Dockerfile:
After I build the image if I try to run my container using the following command:
docker run -d -p 8081:8081 litefs_app
I get the following error:
After some research (including in Fly.io community) I added
--cap-add SYS_ADMIN --device /dev/fuse
or--privileged
to my docker run command, so the full command can be one of the two:docker run --cap-add SYS_ADMIN --device /dev/fuse -d -p 8081:8081 litefs_app
or
docker run --privileged -d -p 8081:8081 litefs_app
With those commands, the container is up and working.
Is there a way to avoid those flags when working on a docker container with LiteFS?
Specifically using
--cap-add SYS_ADMIN
and--privileged
that of course raise security concerns.From what I understand using one of the above is inevitable for LiteFS as those kernel capabilities are required to mount filesystems-->the FUSE file system that is used in LiteFS.
So my questions in terms of security and functionality are as follows.
I will really appreciate any helpful input regarding those issues.
Thanks
The text was updated successfully, but these errors were encountered: