docker container 调试

  1. 查看容器内部执行状态
    docker run –privileged –name Myredis -v /var/lib/redis-data:/data -P –rm redis bash

  2. 查看容器编排 配置
    docker inspect 1fb7b6c8c0d0

  3. 查看容器执行的log
    docker logs 1fb7b6c8c0d0

  4. 后台运行 -d

  5. 随机映射端口 -P 指定映射端口 -p 8080:80

  6. Centos创建sudo用户并且免输sudo密码
    sudo vim /etc/sudoers
    找到#user privilege 的这一行,照着下面root的模式,复制一行将root改为自己的用户名,
    并添加NOPASSWD:ALL。
    root ALL=(ALL) ALL
    test ALL=(ALL) NOPASSWD:ALL
    重新以test登陆,执行sudo的时候就ok了。

  7. Selinux 权限问题 ## docker mariadb /mariadb/”>https://hub.docker.com//mariadb/
    Note that users on host systems with SELinux enabled may see issues with this. The current workaround is to assign the relevant SELinux policy type to the new data directory so that the container will be allowed to access it:
    $ chcon -Rt svirt_sandbox_file_t /my/own/datadir

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值