docker-library/memcached

No documentation

VictorKrasnov opened this issue · 4 comments

Please add readme with docker-compose examples to configure settings like below:

environment:
  - MEMCACHED_MAXCONN=1024
  - MEMCACHED_CACHESIZE=1024
  - MEMCACHED_THREADS=8

And how to check does it work or not.

Does memcached itself support those environment variables? (We don't add any extra behavior here for handling environment variables like in some other images.)

I guess https://github.com/memcached/memcached/wiki/ConfiguringServer#inspecting-running-configuration is probably the best way to check if your settings are actually working, but we don't add anything extra above what memcached itself does in this regard.

Tianon, it was just example. Memcached doesn't support it. But a lot of images supports something like this.

I have found the solution myself. The correct docker-compose.yml file is:

version: '3'
services:
  memcached:
    image: memcached:alpine
    restart: always
    command: "-c ${MEMCACHED_CONN_LIMIT} -m ${MEMCACHED_MEMORY_LIMIT} -t ${MEMCACHED_THREADS}"

I think this example or some more examples how to use docker-entrypoint should be written in README.md.

There's, uh, not much to document in our docker-entrypoint.sh script:

#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- memcached "$@"
fi
exec "$@"