This is a custom Docker image for Memcached preconfigured to support SASL authentication
136
This is a custom Docker image for Memcached (based on this docker compose setup in the Zulip docs), preconfigured to support SASL authentication using plain-text authentication. It automatically sets up the SASL configuration and password database at runtime.
I created it because I was trying to self-host Zulip via Dokku, and couldn't find a decent way to configure Memcached as in the above setup, using the Official memcached plugin for dokku.
1.6.29-alpineClone the repository to your local machine:
git clone https://github.com/engineervix/docker-memcached-sasl.git
cd memcached-sasl
Build the Docker image:
docker build -t your-dockerhub-username/memcached-sasl .
Push the image to Docker Hub (or another container registry):
docker push your-dockerhub-username/memcached-sasl
The following environment variables can be configured when running the container:
SASL_CONF_PATH: Path to the SASL configuration file (default: /home/memcache/memcached.conf).MEMCACHED_SASL_PWDB: Path to the SASL password database (default: /home/memcache/memcached-sasl-db).MEMCACHED_PASSWORD: Password used for the zulip user (default: "REPLACE_WITH_SECURE_MEMCACHED_PASSWORD").The entrypoint script creates the SASL configuration file at the location specified by SASL_CONF_PATH. This file enables the plain-text mechanism for SASL authentication.
The script generates a password database file (MEMCACHED_SASL_PWDB), containing credentials for the user zulip. The username is set as zulip@localhost with the password defined by MEMCACHED_PASSWORD.
The memcached -S command starts Memcached with SASL authentication enabled, enforcing user authentication for all clients.
You can run the image directly using Docker:
docker run -d \
-e MEMCACHED_PASSWORD=your_secure_password \
your-dockerhub-username/memcached-sasl
Or, use this image in a Dokku setup:
sudo dokku memcached:create memcached-zulip \
--image "your-dockerhub-username/memcached-sasl" \
--image-version "latest" \
--custom-env "MEMCACHED_PASSWORD=your_secure_password"
Dockerfile or adjust the entrypoint script.MEMCACHED_PASSWORD environment variable is set to a strong, random value.Content type
Image
Digest
sha256:9da5fb278…
Size
4.5 MB
Last updated
about 2 years ago
docker pull engineervix/memcached-sasl:1.6.29-alpine