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

Add support for passwords #54

Open
melinath opened this issue Oct 2, 2018 · 14 comments
Open

Add support for passwords #54

melinath opened this issue Oct 2, 2018 · 14 comments

Comments

@melinath
Copy link

melinath commented Oct 2, 2018

It would be great to be able to use docker-redis-cluster and put a password in front of it. It's not clear to me from the existing documentation whether that's possible; I'm fairly certain it isn't.

@Grokzen
Copy link
Owner

Grokzen commented Oct 2, 2018

I am not sure if i want to go down this path of adding more and more features that should be configurable somehow because then it could mean that more and more features would want to be added as somehow easy configurable. And it kinda breaks and moves away from the basic idea of this dockerfile as it should be used for a quick bootstrapping of a cluster that you can spin up and use for demos/tests/development and the basic feel from me is that if you need passwords in the base setup, you are probably using it wrong and not for those kinds of intended purposes. Adding a password feels like a production thing.

@melinath
Copy link
Author

melinath commented Oct 2, 2018

We use docker in part so that we can have dev/prod parity; we would like to be able to have our development redis setup be as similar as possible to our production redis setup (which is why we're using a cluster in dev at all rather than a single redis instance). Ideally that would include being able to set a password.

@melinath
Copy link
Author

melinath commented Oct 2, 2018

This is not a blocker for us or anything; we can work around it by configuring our redis location with a URL that does or does not include a password. I get it if it's not a feature you want to support.

@Grokzen
Copy link
Owner

Grokzen commented Oct 2, 2018

I will give it some more thought before deciding, but currently i am leaning towards not to support anything config based or dynamic stuff other then the bare minimum essentials like the IP variable that is required to even get it going. The idea of this one is not to have it production grade and compatible with all different types of systems and solutions. This is intended for dev/test types of environment and not much more. I think there is many other containers out there that would be possible to run at production quality instead of this one.

My current recommendation is that you fork this and modify the config file to your needs and run with that. Or you can make a sub image that overrides the config file. The only case i would be willing to accept is to have something super generic that will enable anyone to have the ability to set any key:value in the config file. I am not up to speed with all options that docker support and if there is some new way to inject stuff during startup or not. If you have any suggestion in this direction i will consider it.

@deddu
Copy link

deddu commented Oct 3, 2018

This is the discussion on the docker redis image, there are few workarounds. It will be nice if we could at least override the command as in the redis vanilla image. See here:

  redis:
    image: redis:4
    ports:
      - "6379:6379"
    command: "--requirepass secret"
  redis_cluster:
    image: grokzen/redis-cluster:4.0.9
    ports:
      - '7000-7007:7000-7007'
    command: "--requirepass secret"
    environment:
      CLUSTER_ONLY: "true"

It should not be a too terrible change

@Grokzen
Copy link
Owner

Grokzen commented Oct 3, 2018

It would require patching the supervisord scripts to allow the injection of the extra stuff. But unless i have access to the content of the variable command inside the container i can't really use it, Maybe patching all cli arguments sent to the docker-entrypoint.sh script and pass it along to redis-server command might work, but not sure if possible.

@gtfd333
Copy link

gtfd333 commented Dec 27, 2018

If can set the password, this is perfect.Waiting for update.

@hoekma
Copy link

hoekma commented Jan 23, 2021

Fyi @Grokzen -- I implemented the option for both providing authentication for default user as well as a custom user through environment variables set during docker container build. It is backward compatible. LMK if you're intereseted in a PR to review.

@kraczak
Copy link

kraczak commented Mar 18, 2021

Is there any update on that? @Grokzen you suggested

I think there is many other containers out there that would be possible to run at production quality instead of this one.

I could not find any example that would work with redis-py-cluster. Would appreciate some suggestions of what other image I could use.

@phuongdm1987
Copy link

Good idea, I have issues with auth on production, so I want test auth on local, too

@phuongdm1987
Copy link

for those who need authentication, I've fork this repository to support authentication.
https://registry.hub.docker.com/r/phuongdm1987/docker-redis-cluster

@tmdgusya
Copy link

tmdgusya commented Feb 9, 2022

@phuongdm1987
how to set password ? using environment?

@tmdgusya
Copy link

tmdgusya commented Feb 9, 2022

@phuongdm1987
Can you show me using docker-compose file?

@phuongdm1987
Copy link

@phuongdm1987 Can you show me using docker-compose file?

@tmdgusya Here is the setup in my docker-compose file.

redis-cluster:
    image: 'phuongdm1987/docker-redis-cluster:1.0.0'
    volumes:
      - 'redis-cluster:/data'
    ports:
      - '7000-7005:7000-7005'
    environment:
      DEFAULT_PASSWORD: 'secret'

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

No branches or pull requests

8 participants