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

How do I set a password for redis? #176

Closed
ddzyan opened this issue Dec 6, 2018 · 3 comments
Closed

How do I set a password for redis? #176

ddzyan opened this issue Dec 6, 2018 · 3 comments
Labels

Comments

@ddzyan
Copy link

@ddzyan ddzyan commented Dec 6, 2018

sudo docker run \
> -p 6379:6379 \
> -v $PWD/data:/data \
> --requirepass "__@picker-redis" \
> --name redis \
> -d redis:3.2 redis-server --appendonly yes
unknown flag: --requirepass
See 'docker run --help'.
@tao12345666333

This comment has been minimized.

Copy link
Contributor

@tao12345666333 tao12345666333 commented Dec 6, 2018

You made the wrong position of the parameter.

You should do it, like this:

sudo docker run \
> -p 6379:6379 \
> -v $PWD/data:/data \
> --name redis \
> -d redis:3.2 redis-server --appendonly yes  --requirepass "__@picker-redis" 
@wglambert wglambert added the question label Dec 6, 2018
@ddzyan

This comment has been minimized.

Copy link
Author

@ddzyan ddzyan commented Dec 6, 2018

You made the wrong position of the parameter.

You should do it, like this:

sudo docker run \
> -p 6379:6379 \
> -v $PWD/data:/data \
> --name redis \
> -d redis:3.2 redis-server --appendonly yes  --requirepass "__@picker-redis" 

Thank you, I will try

@wglambert wglambert closed this Dec 12, 2018
@brunowego

This comment has been minimized.

Copy link

@brunowego brunowego commented May 30, 2019

Sharing this for other users:

Volume

docker volume create redis-data

Running

docker run -d \
  -h redis \
  -e REDIS_PASSWORD=redis \
  -v redis-data:/data \
  -p 6379:6379 \
  --name redis \
  --restart always \
  redis:5.0.5-alpine3.9 /bin/sh -c 'redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}'

Remove

docker rm -f redis
docker volume rm redis-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.