首页 > 系统相关 >Ubuntu系统下安装Dockers

Ubuntu系统下安装Dockers

时间:2023-11-03 17:12:25浏览次数:41  
标签:Dockers 用户组 sudo apt Ubuntu Docker 安装 docker

1、更新系统软件包

在安装 Docker 前,首先需要更新系统软件包,确保系统上的软件都是最新的版本。可以使用以下命令来更新系统:

sudo apt update
sudo apt upgrade

2、安装 Docker CE

Docker 提供了不同版本的安装包,分为社区版(Community Edition,简称 CE)和企业版(Enterprise Edition,简称 EE)。在此教程中,我们将安装 Docker CE。

添加 Docker 官方 GPG 密钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

添加 Docker 包源:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

更新包缓存,并安装 Docker:

sudo apt update
sudo apt install docker-ce

3.验证 Docker 安装是否成功:

安装完成后,可以使用以下命令验证 Docker 是否已经成功安装:

sudo docker version

如果可以正常输出版本信息,则说明 Docker 已经安装成功。

4.配置 Docker 用户组

默认情况下,只有 root 用户或者在 sudoer 列表中的用户才能运行 Docker 命令,而普通用户需要通过 sudo 执行 Docker 命令。为了避免每次运行 Docker 命令都需要输入密码,可以将当前用户添加到 docker 用户组中:

sudo usermod -aG docker $USER

5.重启 Docker 服务

为了使用户组的修改生效,需要重新启动 Docker 服务:

sudo systemctl restart docker

完成后,就可以开始使用 Docker 了

引用原文地址:https://baijiahao.baidu.com/s?id=1778727826518036083&wfr=spider&for=pc

标签:Dockers,用户组,sudo,apt,Ubuntu,Docker,安装,docker
From: https://www.cnblogs.com/Rick-Sanchez/p/17808004.html

相关文章

  • Ubuntu 20↑ 安装postgresql,并且开远程访问。
    postgresql-16安装并且开放外网访问按照官方的教程,我已经将pg官方的地址换成了清华开源镜像站的地址,这样下载的速度更快。安装postgresql下载的源sudosh-c'echo"debhttps://mirrors-i.tuna.tsinghua.edu.cn/postgresql/repos/apt/$(lsb_release-cs)-pgdgmain">/et......
  • Centos7安装Docker
    在CentOS7上安装Docker需要以下步骤:更新系统:使用以下命令更新CentOS系统,确保已经安装了最新的软件包和依赖项。sudoyumupdate安装Docker依赖项:Docker运行需要一些依赖项,使用以下命令安装这些依赖项。sudoyuminstall-yyum-utilsdevice-mapper-persistent-da......
  • Centos7安装openJdk17
    yum安装安装EPEL软件源:使用以下命令安装EPEL软件源,它包含了OpenJDK17的安装包。sudoyuminstallepel-releasesudoyuminstalljava-17-openjdk-develjava--version手动下载压缩包安装解压安装包tar-xvfjdk-17_linux-x64_bin.tar.gz移动解压后的文件夹到/u......
  • pip安装依赖失败
    报错如下Requirementalreadysatisfied:pipinc:\users\ychen\appdata\local\programs\python\python310\lib\site-packages(22.0.4)CollectingpipDownloadingpip-23.3.1-py3-none-any.whl(2.1MB)---------------------------------------0.2/2.1......
  • Linux环境Prometheus接入(一、Prometheus安装)
    环境CentOS7.9安装1、自行下载https://prometheus.io/download/2、命令下载wgethttps://github.com/prometheus/prometheus/releases/download/v2.47.2/prometheus-2.47.2.linux-amd64.tar.gz3、解压tar-zvfprometheus-2.47.2.linux-amd64.tar.gzmvprometheus-2.......
  • Linux环境Prometheus接入(二、Grafana安装)
    环境CentOS7.9安装1、命令下载yuminstall-yhttps://dl.grafana.com/enterprise/release/grafana-enterprise-10.2.0-1.x86_64.rpm2、启动、查看状态systemctlstartgrafana-serversystemctlstatusgrafana-server-l3、修改启动端口cd/etc/grafanavigrafa......
  • VS2022 XAML Styler拓展工具安装失败解决办法
    引言使用VS2022拓展功能在线安装XAMLStyler工具时,会出现安装失败的问题,下面介绍如何解决。其他拓展工具如果安装失败,可以参考相同解决办法。步骤:在VS菜单中选择,Extensions->ManageExtensions在新窗口中,搜索xamlstyler,然后下载对工具下载完成后,关闭VS编译器,会自......
  • Linux版python安装教程
    如果你希望在CentOS上使用源码编译的方式安装Python3,请按照以下步骤进行操作:安装编译工具和依赖项:在开始编译前,需要安装一些编译工具和Python3的依赖项。在终端中运行以下命令:sudoyumgroupinstall"DevelopmentTools"sudoyuminstallopenssl-develbzip2-devellibff......
  • centos7源码安装MySQL 5
    安装前准备检查系统是否安装过mysql:rpm-qa|grepmysql查询所有mysql对应的文件夹,(人工判断不需要后)删除:whereismysqlfind/-namemysql卸载CentOS7系统自带mariadb:#查看系统自带的Mariadbrpm-qa|grepmariadb#卸载系统自带的Mariadbrpm-e--nodepsmariadb-libs#删......
  • Ubuntu离线安装解决办法
    步骤:XXX替换未待安装的的服务名1.查看依赖apt-cachedependsXXX2.下载deb及其依赖包apt-getdownload$(apt-cachedepends--recurse--no-recommends--no-suggests--no-conflicts--no-breaks--no-replaces--no-enhances--no-pre-dependsXXX|grep-vi386|grep"^\w"......