feat(docker): add Dockerfile and devcontainer.json quickstart#16
Merged
Merged
Conversation
The README says smfs works in Docker, devcontainers, Codespaces, and microVMs but ships no working example. e2b ships a Dockerfile and devcontainer.json. This closes the parity gap. - Dockerfile (root): two-stage build from rust:1.80-slim builder to debian:bookworm-slim runtime. Image runs smfs --help out of the box. - docker/Dockerfile.release: pulls binaries via the smfs.ai install script. For users who want a stable image, not a from-source build. - .devcontainer/devcontainer.json: VS Code / Cursor devcontainer config. Builds the root Dockerfile, passes through SUPERMEMORY_API_KEY, mounts /dev/fuse with SYS_ADMIN for FUSE. - .dockerignore: keeps target/, .git/, node_modules out of build context. - README.md: new Docker and devcontainers section with the FUSE caveat called out (--device /dev/fuse --cap-add SYS_ADMIN required).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The README says smfs works wherever a kernel and filesystem exist, naming "macOS, Linux, devcontainers, Codespaces, Docker, microVMs" specifically. The repo at HEAD ships no Dockerfile, no devcontainer config, and no Docker examples. This PR closes that gap: a working Dockerfile, a release variant via the install script, a devcontainer.json with FUSE setup, a
.dockerignore, and a README section.Demo
Why this matters
Today a user who reads the README and tries to run smfs in Docker has to figure out FUSE-in-container, the build pipeline, and the credentials wiring on their own. With this PR,
docker build -t smfs:dev .works out of the box, and the devcontainer makes the same image available inside VS Code or Cursor.Changes
Dockerfile(root): two-stage build. Builder isrust:1.80-slim(matchesrust-toolchain.toml), runtime isdebian:bookworm-slimwithfuse3+ca-certificates. Image runssmfs --helpout of the box.docker/Dockerfile.release: single-stage variant that pulls binaries via the smfs.ai install script. For users who want a stable image, not a from-source build.ARG SMFS_VERSION=latest..devcontainer/devcontainer.json: VS Code / Cursor devcontainer config. Builds the rootDockerfile, passes throughSUPERMEMORY_API_KEY+SUPERMEMORY_API_URL, mounts/dev/fusewithSYS_ADMINfor FUSE..dockerignore: keepstarget/,.git/,node_modules/, Python caches, etc. out of the build context. Build context drops from gigabytes to tens of megabytes.README.md: new## Docker and devcontainerssection after## Build from source. Three subsections: run, devcontainer, FUSE caveat. The FUSE flags (--device /dev/fuse --cap-add SYS_ADMIN) are called out explicitly because Docker daemon defaults don't expose FUSE.Testing
docker build -t smfs:dev .(Dockerfile syntax) — Dockerfile starts with FROM, two-stage build matches the maintainer's existing toolchainpython3 -c "import json; json.load(open('.devcontainer/devcontainer.json'))"— valid JSONcargo build --release --bin smfson host — passes (validates the same compile path the Dockerfile uses)I didn't run the FUSE mount path end-to-end (would require a Linux host with
/dev/fuseexposed). The flag set matches what's documented in thefuserRust crate and whatfuse3requires.AI was used for assistance.