• 非root用户启动redis容器报错mkdir: cannot create directory '/bitnami/redis': Permission denied


    ###问题:
    使用docker启动容器时,报错如下

    ```
    zh@debian:~/testPath$ docker-compose up redis
    Starting testpath_redis_1 ... done
    Attaching to testpath_redis_1
    redis_1 |
    redis_1 | Welcome to the Bitnami redis container
    redis_1 | Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis
    redis_1 | Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis/issues
    redis_1 | Send us your feedback at containers@bitnami.com
    redis_1 |
    redis_1 | INFO ==> ** Starting Redis setup **
    redis_1 | WARN ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
    redis_1 | INFO ==> Initializing Redis...
    redis_1 | mkdir: cannot create directory '/bitnami/redis': Permission denied
    ```
    ###解决方法
    ```
    redis:
    image: "bitnami/redis"
    user: root #注意看这里,添加了这一行后就可以解决
    ports:
    - '127.0.0.1:6379:6379'
    volumes:
    - "/etc/localtime:/etc/localtime:ro"
    - './redis:/bitnami/redis'
    environment:
    - ALLOW_EMPTY_PASSWORD=yes
    restart: always
    ```

  • 相关阅读:
    HDFS的工作流程分析
    linux文本分析利器awk
    二叉树遍历
    tomcat 工作原理简析
    徐汉彬:Web系统大规模并发——电商秒杀与抢购
    牛人博客 列表
    消息队列 概念 配合SpringBoot使用Demo
    Redis 实例排除步骤
    Java分布式 一些概念理解
    消息成功失败回调demo
  • 原文地址:https://www.cnblogs.com/pbblogs/p/11597799.html
Copyright © 2020-2023  润新知