Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker redis default username password

$ docker run --name some-redis -d redis redis-server --requirepass foobared

# verify it worked with
$ docker run -it --link some-redis:redis --rm redis redis-cli -h redis -p 6379
redis:6379> AUTH test
(error) ERR invalid password
redis:6379> AUTH foobared
OK
redis:6379> 


This could be abstracted to an environment variable trivially via something like:
$ docker run --name some-redis -d -e REDIS_PASSWORD=foobared redis sh -c 'exec redis-server --requirepass "$REDIS_PASSWORD"'
Comment

docker redis set password

redis:
    restart: always
    container_name: app-redis
    build:
      context: ./docker/images/redis
      dockerfile: Dockerfile
    ports:
      - "6379:6379"
    volumes:
      - ./docker/images/redis/data:/data
    command: redis-server --requirepass ${REDIS_PASSWORD:-123456}
Comment

docker redis default username password

$ docker run --name some-redis -d redis redis-server --requirepass foobared

# verify it worked with
$ docker run -it --link some-redis:redis --rm redis redis-cli -h redis -p 6379
redis:6379> AUTH test
(error) ERR invalid password
redis:6379> AUTH foobared
OK
redis:6379> 


This could be abstracted to an environment variable trivially via something like:
$ docker run --name some-redis -d -e REDIS_PASSWORD=foobared redis sh -c 'exec redis-server --requirepass "$REDIS_PASSWORD"'
Comment

docker redis set password

redis:
    restart: always
    container_name: app-redis
    build:
      context: ./docker/images/redis
      dockerfile: Dockerfile
    ports:
      - "6379:6379"
    volumes:
      - ./docker/images/redis/data:/data
    command: redis-server --requirepass ${REDIS_PASSWORD:-123456}
Comment

PREVIOUS NEXT
Code Example
Shell :: grep binary files 
Shell :: install perl 5 on ubuntu 2020 
Shell :: set email and name which gets baked into the every git commit in the local config file found in ./.git/config 
Shell :: php install extension 
Shell :: delete a github repository using curl 
Shell :: hostname change inux 
Shell :: configure static ip address ubuntu server 20.04 
Shell :: add ssh key linux 
Shell :: create folder with shell/bash 
Shell :: how to create alias in linux 
Shell :: enable remote desktop powershell server 2019 
Shell :: bash read file content 
Shell :: push a branch with diffrent name 
Shell :: download latest docker-compose 
Shell :: powershell variable to string 
Shell :: redis ubuntu 
Shell :: batch color 
Shell :: angular full installation guide 
Shell :: bash true if grep has output 
Shell :: grep exact match 
Shell :: push docker image to docker hub 
Shell :: how to install cmake ninja 
Shell :: how to add images in readme github 
Shell :: bash script object array 
Shell :: get a loading spinner javascript 
Shell :: git change date 
Shell :: uninstall cinnamon 
Shell :: git apply exclude file 
Shell :: commit changes from different branches 
Shell :: How to get current git id 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =