问题:
使用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

  

非root用户启动redis容器报错mkdir: cannot create directory '/bitnami/redis': Permission denied的更多相关文章

  1. 非root用户执行java进程报错:fork: retry:资源暂时不可用

    vim /etc/security/limits.conf # End of file *           soft   nproc        65535 *           hard   ...

  2. 【出错记录】Tomcat非root用户启动无法拥有权限读写文件

    简单记录下,如有必要,将深入补充: 一.非root用户运行Tomcat及原因 由于项目中,为了安全需要,Tomcat将禁止以root形式启动,原因很简单,举个例子,一旦有人恶意将jsp文件透过某个别的 ...

  3. centos7新增用户并授权root权限、非root用户启动tomcat程序

    一.centos7新增用户并授权root权限 cat /etc/redhat-release查看centos版本号 1.禁用root账户登录 vim /etc/ssh/sshd_config 找到这一 ...

  4. 二进制方式安装docker(非root用户启动docker)

    二进制方式安装docker(非root用户启动docker) 一.下载安装包: 地址:https://download.docker.com/linux/static/stable/x86_64/ 这 ...

  5. 短网址资料-nginx非root用户启动-systemctl启动脚本-分割root权限

    https://www.cnblogs.com/aspnethot/articles/3492191.htmlhttps://www.cnblogs.com/aspnethot/articles/34 ...

  6. zzw原创_非root用户启动apache的问题解决(非root用户启动apache的1024以下端口)

    场景:普通用户编译的apache,要在该用户下启动1024端口以下的apache端口 1.假设普通用户为sims20,用该用户编译 安装了一个apache,安装路径为/opt/aspire/produ ...

  7. Ubuntu配置Tomcat9非root用户启动

    unix类系统的root用户具有极大的权利,所以很多时候我们不希望程序以root身份启动,这也就是配置Tomcat以指定身份(非root)启动的初衷,虽然也没人来攻击我的服务器,但本着学习学习的目的, ...

  8. 使用非root用户启动tomcat

    以下操作均为以root用户运行1.添加tomcat用户组 /usr/sbin/groupadd tomcat 2.添加tomcat用户,并限制登录 /usr/sbin/useradd -s /bin/ ...

  9. Centos6.4 设置开机自动以某个非root用户启动脚本

    开机自动运行脚本,可以将脚本的执行命令放在 /etc/rc.d/rc.local 文件中,但是这样开机自动运行这个脚本的用户默认为root. 如果想以某个非root用户运行脚本,可以使用如下命令: s ...

随机推荐

  1. mint linux 18.3 遇到“已安装的 post-installation 脚本 返回了错误号 127 ”问题的解决

    From https://blog.csdn.net/ropai/article/details/27171687 ubuntu 14.04遇到“已安装的 post-installation 脚本 返 ...

  2. .htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

    php项目 .htaccess文件配置如下: #文件缓存时间配置 <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css)$"& ...

  3. 关于全局变量,static,define和const

        其实按照现在主流的观点,应该尽量少用全局变量和define,尽量多用临时变量,并且用const替换值define,用短小精悍的函数替换函数define.     对这些我倒是也没有什么意见,只 ...

  4. python 匿名函数&内置函数

    匿名函数:为了解决那些功能很简单的需求而设计的一句话函数怎么定义匿名函数: cal = lambda x : x*x # cal是函数名,lambda是定义匿名函数的关键字 冒号前面的额x是参数即函数 ...

  5. 移动端常用UI框架

    作为一个前端人员来说,总结几款相对来说不错的用于移动端开发的UI框架是非常必要的,以下几种移动端UI框架就能基本满足工作中开发需要,根据项目需求,选用合适的框架搭建项目,更能容易提高开发效率. 一.M ...

  6. [Linux]Ubuntu与终端破墙

    参考:https://www.jianshu.com/p/941bf811f9c2 亲测在ubuntu-14.04.4-desktop-amd64.iso上安装成功 福利:https://github ...

  7. 浅谈 MongoDB

    MongoDB 是一个基于分布式文件存储的数据库.由 C++ 语言编写.旨在为 WEB 应用提供可扩展的高性能数据存储解决方案.他支持的数据结构非常松散,是类似json的bson格式,因此可以存储比较 ...

  8. JeeWx全新版本发布!捷微二代微信活动平台1.0发布!活动插件持续开源更新!

    JeeWx捷微二代微信活动平台 (专业微信营销活动平台,活动插件持续更新ing~)    终于等到你!还好我没放弃! 在团队持续多年的努力下,Jeewx微信管家和H5活动平台不断更新迭代,积累了许许多 ...

  9. Python——Django运行问题

    1.Python3.7+Django2.2操作Mysql数据库时出现如下错误:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3. ...

  10. lnmp之Nginx配置https加密访问

    配置lnmp之Nginx网站支持https加密访问 注: 1. 这里拿购买的(pxsnx.pxjy.com)证书来做样例 证书文件共有三个---> (pxsnxg.pxjy.com_ca.crt ...