首页 > 系统相关 >install docker on ubuntu

install docker on ubuntu

时间:2024-09-20 11:01:34浏览次数:1  
标签:sudo apt Step install ubuntu docker Docker

To install Docker on Ubuntu, you can follow these steps:

Step 1: Update the system

Open a terminal and run the following command to update your package list:

sudo apt-get update

Step 2: Install required dependencies

Run the following command to install the necessary packages for Docker installation:

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

Step 3: Add Docker's official GPG key

Add Docker's GPG key to ensure the authenticity of the Docker package:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 4: Set up the Docker repository

Add Docker’s repository to your APT sources:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 5: Update the package list again

Update the APT package list to reflect the new Docker repository:

sudo apt-get update

Step 6: Install Docker

Now, you can install Docker by running the following command:

sudo apt-get install docker-ce

Step 7: Check Docker installation

Once the installation is complete, you can verify if Docker is installed correctly by running:

sudo docker --version

Step 8: Manage Docker as a non-root user (optional)

To avoid using sudo with Docker commands, add your user to the docker group:

sudo usermod -aG docker $USER

Then, log out and log back in for this change to take effect.


That's it! Docker should now be installed and running on your Ubuntu system.

标签:sudo,apt,Step,install,ubuntu,docker,Docker
From: https://www.cnblogs.com/Tifahfyf/p/18422095

相关文章

  • Ubuntu20.04分区方案
    Ubuntu20.04的分区方案可以按照以下建议进行:一、常见分区方案 -EFI系统分区(逻辑分区):   -文件系统类型:无特定提及(通常为FAT32等适用于UEFI引导的格式)   -空间大小:4G(4096MB),这个容量足够用于UEFI引导,其作用和boot引导分区类似,但在UEFI引导下使用,默认grub引导......
  • 常规web项目 docker-compose 例子
    version:'3.1'services:db:image:postgres:13.1container_name:com_dbenvironment:POSTGRES_USER:rootPOSTGRES_PASSWORD:db123POSTGRES_DB:dbvolumes:-/opt/work/DDDDD/platform/com_db/db_data:/var......
  • 在ubuntu运行一个war
    在Ubuntu上运行一个.war文件(通常是Web应用归档文件)通常需要使用一个JavaServlet容器,例如ApacheTomcat。以下是如何在Ubuntu上运行.war文件的详细步骤。1.安装Java首先,确保你已经安装了Java运行环境,因为.war文件是基于Java的Web应用。1.1检查Java版......
  • Ubuntu 18.04.6 TLS版本安装docker问题
    技术问题求助:版本号:Ubuntu18.04.6TLSDockerversion24.0.2,buildcb74dfc使用以上版本的ubuntu安装完成docker,安装完成之后使用docker下载镜像,报以下错误:尝试1:修改镜像源:新建文件:vim/etc/docker/daemon.jsonroot@ubuntu:~#cat/etc/docker/daemon.json内容如......
  • windows安装docker
    环境准备启用Hyper-V打开windows功能,找到Hyper-V并勾选,如果找不到Hyper-V新建txt,然后编辑内容pushd"%~dp0"dir/b%SystemRoot%\servicing\Packages\*Hyper-V*.mum>hyper-v.txtfor/f%%iin('findstr/i.hyper-v.txt2^>nul')dodism/online/norestart/add-p......
  • ubuntu安装emqx
    目录1.预先下载好emqx压缩包2.使用tar命令解压3.进入bin目录5.放开访问端口180836.从通过ip地址访问emqx后台7.默认用户名密码为admin/public8.登录后台9.资源包绑定在此博文可自取1.预先下载好emqx压缩包2.使用tar命令解压sudotar-xzvfemqx-5.0.8-el8-amd6......
  • 全网最简单ubuntu18.04+mysql5.7+nginx+uwsgi一次性部署Django!!!!!
    ubuntu18.04,自带python3.6,mysql5.7 Nginx*******************************1.安装nginx apt-getupdate apt-getupgrade apt-getinstallnginx 2.修改端口为81(可选),是一个链接 /etc/nginx/sites-enabled/default3.servicenginxreload4.servicenginx......
  • 常见Docker命令
    要重启运行中的Docker容器,您可以使用以下命令:重启单个容器:dockerrestart<container_name或container_id>例如,如果您的容器名称为”my-rabbit”,则可以执行以下命令来重启该容器:dockerrestartmy-rabbit重启所有正在运行的容器:dockerrestart$(dockerps-q)这将......
  • 虚拟机ubuntu增加磁盘
    虚拟机软件vmware,系统ubuntu16.04系统存储空间不够用了,需要扩充一下,记录一下操作步骤。先关掉虚拟机系统,打开虚拟机设置--硬件--选中“硬盘”--点击右侧的“扩展”按钮,输入想要的空间大小,点“确定”,启动虚拟机。进入虚拟机后,打开终端,使用fdisk查看分区信息:robot@ubuntu:~$s......
  • 使用 Docker 安装 TensorFlow 并设置 GPU/CPU 支持
    GPU云服务器(CloudGPUService)是基于GPU的快速、稳定、弹性的计算服务,主要应用于深度学习训练/推理、图形图像处理以及科学计算等场景。GPU云服务器提供和标准CVM云服务器一致的方便快捷的管理方式。GPU云服务器通过其强大的快速处理海量数据的计算性能,有效解放用户的计算......