Sign inSign up

tigersmile/memcached

By tigersmile

β€’Updated over 1 year ago

Tiny Memcached (micro/slim/TLS/full), static scratch builds, fully env-configurable.

Image
Web servers
Content management system
Databases & storage
0

3.7K

tigersmile/memcached repository overview

⁠🐳 memcached-docker

A deep-optimized Memcached (1.6.38) Docker suite focused on stripping the server down to its absolute essentialsβ€”producing some of the smallest and most secure Memcached images available. Each variant is engineered to remove unnecessary features, binaries, and files, creating ultra-compact, scratch-based containers ready for production.

Built for:

  • βœ… Maximum minimalism: Images as small as ~124 KB (amd64).
  • βœ… No clutter: Zero shell, zero OSβ€”just Memcached.
  • βœ… Container-native configuration: Full environment variable support (no CLI args required).
  • βœ… Variants: micro, slim, tls, fullβ€”scale up or down to match your needs.

Multi-arch support:

Architecture
linux/386βœ…
linux/amd64βœ…
linux/arm/v6βœ…
linux/arm/v7βœ…
linux/arm64/v8βœ…
linux/ppc64leβœ…
linux/s390xβœ…

β πŸ“Œ Purpose

Purpose: This project’s core mission is to shrink Memcached as much as possible while keeping it fast, secure, and flexibleβ€”ideal for cloud, edge, and microservice environments.

  • βœ… Zero-config: Fully operational out of the box with environment variable support.
  • βœ… Optimized builds: From minimal (micro) to fully-featured (full).
  • βœ… Platform-agnostic: Multi-architecture support (x86, ARM, etc.).

β πŸš€ Why Tiny & Scratch-Based?

β πŸ”Ή Ultra-Small Image Size
ArchitectureImage Size
linux/amd64πŸš€ 123.97 KB βœ…
linux/386133.05 KB
linux/arm/v7132.77 KB
linux/arm/v6129.43 KB
linux/arm64/v8126.94 KB
linux/ppc64le135.63 KB
linux/s390x161.00 KB

βœ… ~124 KB for amd64? That’s next-level lightweight.

Benefits:

  • πŸš€ Faster pulls & deploys: Minimal size means near-instant startupβ€”critical for CI/CD and edge.
  • πŸ”’ Smaller attack surface: Fewer bits = fewer vulnerabilities.
  • 🌍 Low bandwidth/storage: Ideal for constrained environments (IoT, microVMs, etc.).

β πŸ”Ή Scratch Base Advantages
  • 🧼 Nothing extra: scratch = no shell, no libc, no package managerβ€”only Memcached itself.
  • πŸ” Locked down: No way to exec or misuse the imageβ€”great for high-security setups.
  • πŸ›  Predictable: No hidden base layers; what you ship is exactly what runs.
  • βœ… Audit-friendly: Minimal image = simpler compliance and auditing.

β πŸš€ Image Variants

Image TagFeatures
tigersmile/memcached:micro🟒 Minimal build:
- TCP only (no UDP/socket)
- Binary & text protocols
- No TLS, SASL, or extstore
tigersmile/memcached:slim🟒 Mid-tier:
- TCP only
- Enhanced features for higher load
- No TLS
tigersmile/memcached:tls🟒 Adds TLS:
- TCP only
- TLS encryption
- No SASL
tigersmile/memcached:full🟒 Fully-featured:
- TCP only
- TLS + SASL + extstore

πŸ›‘ Note: All variants exclusively support TCP trafficβ€”no UNIX socket or UDP support.


β πŸ›  Features

  • βœ… Environment-driven configuration (no CLI args needed)
  • βœ… TLS support (tls/full)
  • βœ… SASL support (full)
  • βœ… Extstore support (full)
  • βœ… Alpine-based minimal size
  • βœ… Scratch containers (no shell, no extras)

⁠πŸ“₯ Usage Example

docker run -d \
  --name my-memcached \
  -e MEMCACHED_MEMORY_LIMIT=512 \
  -e MEMCACHED_CONNECTIONS=1024 \
  tigersmile/memcached:micro

CLI arguments are optional:

docker run -d \
  --name my-memcached \
  tigersmile/memcached:micro -m 512 -c 1024

β πŸ” TLS Setup

1️⃣ Generate certs:

mkdir certs
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 \
  -nodes -keyout certs/server.key -out certs/server.crt \
  -subj "/CN=localhost"

2️⃣ Launch TLS container:

docker run -d \
  --name memcached-tls \
  -e MEMCACHED_TLS=1 \
  -e MEMCACHED_TLS_CERT=/certs/server.crt \
  -e MEMCACHED_TLS_KEY=/certs/server.key \
  -v $(pwd)/certs:/certs:ro \
  tigersmile/memcached:tls

β πŸ—„οΈ Extstore Setup

docker run -d \
  --name memcached-full \
  -e MEMCACHED_EXTSTORE_PATH=/extstore:1G \
  -v /path/to/extstore:/extstore \
  tigersmile/memcached:full

Customizable with:

  • MEMCACHED_EXTSTORE_PAGE_SIZE
  • MEMCACHED_EXTSTORE_WBUF_SIZE

β πŸ“Š Environment Variables Overview

VariableDescriptionmicroslimtlsfull
MEMCACHED_MEMORY_LIMITMemory limit (MB)βœ…βœ…βœ…βœ…
MEMCACHED_CONNECTIONSMax simultaneous connectionsβœ…βœ…βœ…βœ…
MEMCACHED_THREADSNumber of worker threadsβœ…βœ…βœ…βœ…
MEMCACHED_PROTOCOLProtocol (ascii, binary, auto)βœ…βœ…βœ…βœ…
MEMCACHED_REQS_PER_EVENTMax requests per eventβœ…βœ…βœ…βœ…
MEMCACHED_FACTORSlab growth factorβœ…βœ…βœ…βœ…
MEMCACHED_MAX_ITEM_SIZEMax item sizeβœ…βœ…βœ…βœ…
MEMCACHED_MIN_ITEM_SIZEMin item sizeβœ…βœ…βœ…βœ…
MEMCACHED_LISTEN_BACKLOGListen backlog sizeβœ…βœ…βœ…βœ…
MEMCACHED_KEY_DELIMITERKey delimiter characterβœ…βœ…βœ…βœ…
MEMCACHED_ALLOW_SHUTDOWNEnable ASCII shutdown commandβœ…βœ…βœ…βœ…
MEMCACHED_DISABLE_CASDisable CASβœ…βœ…βœ…βœ…
MEMCACHED_LOCK_PAGESLock paged memoryβœ…βœ…βœ…βœ…
MEMCACHED_ENABLE_COREDUMPSEnable coredumpsβœ…βœ…βœ…βœ…
MEMCACHED_ENABLE_LARGEPAGESEnable large pagesβœ…βœ…βœ…βœ…
MEMCACHED_DISABLE_FLUSH_ALLDisable flush_all commandβŒβœ…βœ…βœ…
MEMCACHED_DISABLE_DUMPINGDisable stats cachedump/lru_crawler metadumpβŒβœ…βœ…βœ…
MEMCACHED_DISABLE_WATCHDisable watch commandsβŒβœ…βœ…βœ…
MEMCACHED_VERBOSEVerbosity levelβœ…βœ…βœ…βœ…
MEMCACHED_SASLEnable SASL authenticationβŒβŒβŒβœ…
MEMCACHED_TLSEnable TLSβŒβŒβœ…βœ…
MEMCACHED_TLS_CERTTLS certificate pathβŒβŒβœ…βœ…
MEMCACHED_TLS_KEYTLS key pathβŒβŒβœ…βœ…
MEMCACHED_TLS_CATLS CA certificate pathβŒβŒβœ…βœ…
MEMCACHED_TLS_VERIFY_MODETLS verify modeβŒβŒβœ…βœ…
MEMCACHED_EXTSTORE_PATHExtstore path + sizeβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_PAGE_SIZEExtstore page sizeβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_WBUF_SIZEExtstore write buffer sizeβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_THREADSExtstore thread countβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_ITEM_SIZEExtstore item sizeβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_ITEM_AGEExtstore item ageβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_LOW_TTLExtstore low TTLβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_DROP_UNREADExtstore drop unread flagβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_RECACHE_RATEExtstore recache rateβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_COMPACT_UNDERExtstore compact thresholdβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_DROP_UNDERExtstore drop thresholdβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_MAX_FRAGExtstore max fragmentationβŒβŒβŒβœ…
MEMCACHED_EXTSTORE_MAX_SLEEPExtstore max sleep timeβŒβŒβŒβœ…
MEMCACHED_SLAB_AUTOMOVE_FREERATIOSlab automove freeratioβœ…βœ…βœ…βœ…
MEMCACHED_NAPI_IDSNAPI IDsβœ…βœ…βœ…βœ…

This table lists all supported environment variables, with checkmarks showing which variants implement each. Memcached maps them automatically if the feature is available.

⁠⚠️ Notes

  • TCP-only: All builds exclusively support TCP (no UNIX/UDP).
  • Scratch containers: No shell or package manager.
  • Flexible config: Env vars auto-map to CLI options; CLI args still work.
  • Ulimits: High concurrency may require raising limits:
ulimits:
  nofile:
    soft: 65535
    hard: 65535


β βœ… Status

  • βœ… Multi-arch builds: x86, ARM (32 & 64-bit), PPC, s390x.
  • βœ… Fully environment-configurable.
  • βœ… TLS & extstore tested.
  • 🚧 SASL: implemented but pending full test suite.

Enjoy lightning-fast, container-optimized Memcached πŸš€

Tag summary

Content type

Image

Digest

sha256:1239f89cb…

Size

1.2 MB

Last updated

over 1 year ago

docker pull tigersmile/memcached