Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "smfs",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
},
"runArgs": [
"--device",
"/dev/fuse",
"--cap-add",
"SYS_ADMIN"
],
"overrideCommand": true,
"remoteEnv": {
"SUPERMEMORY_API_KEY": "${localEnv:SUPERMEMORY_API_KEY}",
"SUPERMEMORY_API_URL": "${localEnv:SUPERMEMORY_API_URL}"
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
}
}
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.git/
.devcontainer/
target/

bash/node_modules/
bash/.turbo/
bash/dist/
bash/coverage/

bash-py/.venv/
bash-py/__pycache__/
bash-py/.pytest_cache/
bash-py/dist/
bash-py/build/
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rust:1.80-slim AS builder

WORKDIR /src
ENV RUSTUP_TOOLCHAIN=1.80.0

RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

COPY . .

RUN cargo build --release --bin smfs

FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
fuse3 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /src/target/release/smfs /usr/local/bin/smfs

ENTRYPOINT ["smfs"]
CMD ["--help"]
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Two access flows depending on the runtime:
- [Semantic search](#semantic-search)
- [`bash/` virtual bash tool](#bash-virtual-bash-tool)
- [Build from source](#build-from-source)
- [Docker and devcontainers](#docker-and-devcontainers)
- [License](#license)

## Install
Expand Down Expand Up @@ -152,6 +153,63 @@ cargo build --release

Requires Rust 1.80 or newer.

## Docker and devcontainers

### Run smfs in Docker

Build the development image from this checkout:

```sh
docker build -t smfs:dev .
docker run --rm smfs:dev --help
```

Mount a Supermemory container inside Docker with FUSE enabled:

```sh
docker run --rm -it \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-e SUPERMEMORY_API_KEY="$SUPERMEMORY_API_KEY" \
smfs:dev mount agent_memory --path /mnt/memory
```

The release Dockerfile uses the same installer as the shell quickstart:

```sh
docker build -t smfs:release -f docker/Dockerfile.release .
```

When an official image is published, the same run flags apply:

```sh
docker run --rm -it \
--device /dev/fuse \
--cap-add SYS_ADMIN \
-e SUPERMEMORY_API_KEY="$SUPERMEMORY_API_KEY" \
ghcr.io/supermemoryai/smfs:latest mount agent_memory --path /mnt/memory
```

### Use smfs inside a devcontainer

Open this repository in VS Code or Cursor and choose "Reopen in Container".
The devcontainer builds the root `Dockerfile`, passes through `SUPERMEMORY_API_KEY`
and `SUPERMEMORY_API_URL`, and starts with `smfs` on `PATH`.

### FUSE requirements

Docker runs Linux containers, so smfs uses the FUSE backend in Docker. The NFS
backend is for macOS hosts and is not used inside Linux containers.

FUSE needs access to `/dev/fuse` and the `SYS_ADMIN` capability:

```sh
--device /dev/fuse --cap-add SYS_ADMIN
```

If your Docker environment does not expose `/dev/fuse`, use a Linux host or a
container runtime that supports FUSE devices.

## License

MIT. See [`LICENSE`](LICENSE).
14 changes: 14 additions & 0 deletions docker/Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
fuse3 \
&& rm -rf /var/lib/apt/lists/*

ARG SMFS_VERSION=latest

RUN curl -fsSL https://smfs.ai/install | SMFS_INSTALL_DIR=/usr/local/bin bash -s -- "${SMFS_VERSION}"

ENTRYPOINT ["smfs"]
CMD ["--help"]