docker-library / memcached

Docker Official Image packaging for memcached
http://memcached.org/
BSD 3-Clause "New" or "Revised" License
132 stars 99 forks source link

No documentation #84

Closed VictorKrasnov closed 10 months ago

VictorKrasnov commented 1 year ago

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.

tianon commented 1 year ago

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

tianon commented 1 year ago

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.

VictorKrasnov commented 1 year ago

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.

tianon commented 1 year ago

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

https://github.com/docker-library/memcached/blob/32c314b7d14f704aa7596d748a3024043c6e9a7e/debian/docker-entrypoint.sh#L1-L9

jaydorsey commented 3 weeks ago

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

I agree with you (even though ticket this was closed); your example was all that I needed to push me in the right direction, so thank you for sharing it.

It took way longer than it should have to figure out how to do this, due to a bunch of half-complete examples that popped up first with a google docker-compose memcached log.

I maybe should have tried chatgpt first, but I tried it after and it suggested something that doesn't even appear to be remotely correct. Hopefully the next person that tries to configure memcached for docker compose to customize the arguments will stumble upon this post

LaurentGoderre commented 3 weeks ago

@jaydorsey https://github.com/docker-library/docs/pull/2494