zoukankan      html  css  js  c++  java
  • Add User To Docker Group In Ubuntu Linux

    Add User To Docker Group In Ubuntu Linux

    By default, the docker command should run with root privileges. To run Docker as a non-root user in Ubuntu, you have to add the user to the docker group. Otherwise, you will receive an error.

    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied

    First check if the docker group already exists on your Ubuntu system:

    grep docker /etc/group
    Got permission denied while trying to connect to the Docker daemon

    If the group already in there, add the user to the docker group using the usermod command.

    usermod -aG docker user_name

    Make sure you replace the user_name with your own. To add yourself (the current logged in user), run:

    usermod -aG docker $USER

    The user needs to Log out and log back into the Ubuntu server so that group membership is re-evaluated. After that the user will be able to run Docker commands without using root or sudo.

    If the group does not exist, Create the docker group:

    sudo groupadd docker

    And restart the docker service:

    sudo systemctl restart docker
  • 相关阅读:
    linux I2C 读写 tlv320dac3100
    ubuntu lfs
    安装和使用花生壳(linux)
    vim 配置
    vim
    gnome2 恢复默认 panel
    ubuntu 挂在 jffs2 文件
    gstreamer 播放
    gstreamer 环境变亮设置
    探讨【IGE】的源代码【五】。
  • 原文地址:https://www.cnblogs.com/mouseleo/p/13310170.html
Copyright © 2011-2022 走看看