{"id":50570886,"url":"https://github.com/vyavdoshenko/dragonfly-docker-dev","last_synced_at":"2026-06-04T18:30:48.534Z","repository":{"id":350241560,"uuid":"1205958584","full_name":"vyavdoshenko/dragonfly-docker-dev","owner":"vyavdoshenko","description":"Docker development environment for building and contributing to Dragonfly - an in-memory data store compatible with Redis and Memcached APIs","archived":false,"fork":false,"pushed_at":"2026-05-04T20:01:18.000Z","size":867,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T21:34:22.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vyavdoshenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-09T12:49:20.000Z","updated_at":"2026-05-04T20:01:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vyavdoshenko/dragonfly-docker-dev","commit_stats":null,"previous_names":["vyavdoshenko/dragonfly-docker-dev"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vyavdoshenko/dragonfly-docker-dev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyavdoshenko%2Fdragonfly-docker-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyavdoshenko%2Fdragonfly-docker-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyavdoshenko%2Fdragonfly-docker-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyavdoshenko%2Fdragonfly-docker-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vyavdoshenko","download_url":"https://codeload.github.com/vyavdoshenko/dragonfly-docker-dev/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyavdoshenko%2Fdragonfly-docker-dev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33916320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T18:30:48.468Z","updated_at":"2026-06-04T18:30:48.521Z","avatar_url":"https://github.com/vyavdoshenko.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dragonfly Docker Development Environment\n\nA ready-to-use Docker container for building and developing [Dragonfly](https://github.com/dragonflydb/dragonfly) — an in-memory data store compatible with Redis and Memcached APIs that delivers up to 25x more throughput than Redis.\n\n## What you get\n\nAfter setup, you will have a Docker container with:\n\n- **Full C++ toolchain** — Clang 18, CMake, Ninja, Mold linker, ccache\n- **All Dragonfly dependencies** pre-installed (Boost, libevent, libssl, RE2, etc.)\n- **Debugging and profiling** — GDB, Valgrind, AFL++ fuzzer\n- **Benchmarking** — memtier-benchmark, redis-cli\n- **Modern shell** — Zsh with Oh-My-Zsh, syntax highlighting, autosuggestions, vi-mode\n- **Modern CLI tools** — ripgrep, fd, eza, bat, jq, htop\n- **Additional languages** — Python 3.10, Node.js LTS, Go 1.24, Rust\n- **Docker-in-Docker** support\n- **Neovim** as default editor\n\nYour Dragonfly source code is mounted from the host, so you can edit with your preferred IDE and build inside the container.\n\n## Prerequisites\n\n- Docker\n- Git\n- ~5 GB disk space for the container image\n\n## Quick start\n\n### 1. Clone Dragonfly\n\n```sh\ncd ~\ngit clone --recursive https://github.com/dragonflydb/dragonfly\n```\n\n\u003e **Important:** Use `--recursive` to fetch all submodules.\n\n### 2. Clone this repository\n\n```sh\ncd ~\ngit clone https://github.com/vyavdoshenko/dragonfly-docker-dev\ncd dragonfly-docker-dev\n```\n\n### 3. Build the container image\n\n```sh\ndocker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t builder .\n```\n\nThe `UID`/`GID` arguments ensure file permissions inside the container match your host user — files you create won't end up owned by root.\n\n### 4. Add shell helper functions\n\nAdd the following functions to your `~/.zshrc` (or `~/.bashrc`). These are taken from [vyavdoshenko/orgmode/zshrc.org](https://github.com/vyavdoshenko/orgmode/blob/main/zshrc.org) and provide convenient container management:\n\n```sh\nbuild() {\n  if [ -z \"$1\" ]; then\n    echo \"Error: You must specify the image tag!\"\n    echo \"Usage example: build my_project\"\n    return 1\n  fi\n  docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t \"$1\" .\n}\n\nrun() {\n  if [ -z \"$1\" ]; then\n    echo \"Error: You must specify the image name!\"\n    echo \"Usage example: run builder [container_name] [additional_docker_params]\"\n    return 1\n  fi\n\n  local image_name=\"$1\"\n  local container_name=\"${2:-${image_name}-container}\"\n  local project_dir=\"${HOME}/${image_name}\"\n  shift\n  if [ $# -gt 0 ]; then shift; fi\n\n  # Reattach if the container already exists\n  if [ \"$(docker ps -a -q -f name=${container_name})\" ]; then\n    docker start -ai \"${container_name}\"\n    return 0\n  fi\n\n  docker run --user builder \"$@\" \\\n    --mount type=bind,source=\"${project_dir}\",destination=\"/home/builder/${image_name}\" \\\n    --mount type=bind,source=\"${HOME}/.ssh\",destination=\"/home/builder/.ssh\",readonly \\\n    --mount type=bind,source=\"${HOME}/.gitconfig\",destination=\"/home/builder/.gitconfig\",readonly \\\n    -v /var/run/docker.sock:/var/run/docker.sock \\\n    --privileged \\\n    -it --name \"${container_name}\" \"${image_name}\" /usr/bin/zsh\n}\n\nrestart() {\n  if [ -z \"$1\" ]; then\n    echo \"Error: You must specify the image name!\"\n    echo \"Usage example: restart builder [container_name]\"\n    return 1\n  fi\n\n  local image_name=\"$1\"\n  local container_name=\"${2:-${image_name}-container}\"\n\n  if [ \"$(docker ps -a -q -f name=${container_name})\" ]; then\n    docker rm -f \"${container_name}\"\n  fi\n\n  run \"$@\"\n}\n\nattach() {\n  if [ -z \"$1\" ]; then\n    echo \"Error: You must specify the image name!\"\n    echo \"Usage example: attach builder\"\n    return 1\n  fi\n  docker exec -it \"${1}-container\" /usr/bin/zsh\n}\n```\n\nThen reload your shell:\n\n```sh\nsource ~/.zshrc\n```\n\n### 5. Start the container\n\n```sh\nrun dragonfly\n```\n\nThis will:\n- Mount `~/dragonfly/` (the Dragonfly source) into the container at `/home/builder/dragonfly`\n- Mount your SSH keys (read-only) and gitconfig for Git operations\n- Forward the Docker socket for Docker-in-Docker\n- Drop you into a Zsh shell inside the container\n\n\u003e **Note:** The `run` function names the container `dragonfly-container`. If you stop and `run dragonfly` again, it reattaches to the existing container — your state is preserved.\n\nTo start a fresh container (discarding container state):\n\n```sh\nrestart dragonfly\n```\n\nTo open a second shell in a running container:\n\n```sh\nattach dragonfly\n```\n\n### Passing additional Docker parameters\n\nThe `run` function accepts extra Docker flags after the container name. For example, to use host networking:\n\n```sh\nrun dragonfly dragonfly --network host\n```\n\nYou can also create a custom network and run multiple containers — useful for testing replication or cluster setups:\n\n```sh\n# Create a dual-stack bridge network\ndocker network create --driver bridge --subnet=192.168.100.0/24 --ipv6 --subnet=deaf:b19:d00d::/64 df-net\n\n# Start a container with a specific IP\nrun dragonfly dragonfly --network df-net --ip 192.168.100.2 --ip6 deaf:b19:d00d::2\n\n# Start a second container (e.g., for replication)\nrun dragonfly dragonfly-main --network df-net --ip 192.168.100.3 --ip6 deaf:b19:d00d::3\n```\n\n\u003e The second argument is the container name. When omitted, it defaults to `\u003cimage_name\u003e-container`.\n\n## Building Dragonfly inside the container\n\nOnce inside the container:\n\n```sh\ncd ~/dragonfly\n\n# Configure (release build)\n./helio/blaze.sh -release\n\n# Build\ncd build-opt\nninja dragonfly\n```\n\nRun the server:\n\n```sh\n./dragonfly --alsologtostderr\n```\n\nDragonfly responds to both Redis and HTTP on port `6379`. Test it:\n\n```sh\nredis-cli ping\n# PONG\n```\n\n### Debug build\n\n```sh\ncd ~/dragonfly\n./helio/blaze.sh    # without -release\ncd build-dbg\nninja dragonfly\n```\n\n### Useful build flags\n\nFor a minimal build (faster compilation):\n\n```sh\n./helio/blaze.sh -DUSE_MOLD:BOOL=ON -DWITH_AWS:BOOL=OFF -DWITH_GCP:BOOL=OFF\n```\n\n## Log colorization\n\nThe container includes a `colorize` utility that highlights Dragonfly log output. Pipe build or runtime output through it:\n\n```sh\n./dragonfly --alsologtostderr 2\u003e\u00261 | colorize\n```\n\n![colorize](img/colorize.png)\n\n- Lines starting with `I` (info) are highlighted in green\n- Lines starting with `W` (warning) in yellow\n- Lines starting with `E` (error) in red\n\nUse `colorize cut` for a compact view that strips timestamps:\n\n```sh\n./dragonfly --alsologtostderr 2\u003e\u00261 | colorize cut\n```\n\n![colorize cut](img/colorize_cut.png)\n\n## Benchmarking\n\nThe container includes [memtier-benchmark](https://github.com/RedisLabs/memtier_benchmark) for performance testing:\n\n```sh\n# Start Dragonfly first, then in another shell:\nmemtier_benchmark --threads=4 --test-time=30\n```\n\n## Multi-architecture build (ARM64)\n\nTo build the container for ARM64 (e.g., Apple Silicon host targeting ARM):\n\n```sh\ndocker run --rm --privileged multiarch/qemu-user-static --reset -p yes\ndocker build --platform linux/arm64 --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t builder .\n```\n\n## What's inside\n\n| Category | Tools |\n|---|---|\n| **C++ Toolchain** | Clang 18, GCC/G++, CMake, Ninja, Mold, ccache, LLD 18 |\n| **Debugging** | GDB, Valgrind, AFL++ 4.34c (with persistent record) |\n| **Libraries** | Boost, libevent, libssl, zlib, libunwind, RE2, libxml2, libzstd |\n| **Benchmarking** | memtier-benchmark, redis-cli |\n| **Languages** | Python 3.10 (venv), Node.js LTS, Go 1.24.1, Rust |\n| **Editors** | Neovim, Vim |\n| **Shell** | Zsh, Oh-My-Zsh, syntax highlighting, autosuggestions, vi-mode |\n| **CLI Tools** | ripgrep, fd, eza, bat, jq, htop, tmux, mc |\n| **Containers** | Docker CE, docker-compose, buildx |\n| **Network** | iproute2, netcat, telnet, ping, net-tools |\n| **VCS** | Git, GitHub CLI (gh) |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyavdoshenko%2Fdragonfly-docker-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvyavdoshenko%2Fdragonfly-docker-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyavdoshenko%2Fdragonfly-docker-dev/lists"}