Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documentation #84

Closed
VictorKrasnov opened this issue Feb 3, 2023 · 6 comments
Closed

No documentation #84

VictorKrasnov opened this issue Feb 3, 2023 · 6 comments

Comments

@VictorKrasnov
Copy link

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
Copy link
Member

tianon commented Feb 3, 2023

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
Copy link
Member

tianon commented Feb 3, 2023

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
Copy link
Author

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
Copy link
Member

tianon commented Feb 8, 2023

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 "$@"

@tianon tianon closed this as completed Dec 19, 2023
@jaydorsey
Copy link

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
Copy link
Member

@jaydorsey docker-library/docs#2494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants