Installing Docker on Ubuntu(记录)

本文提供了一个简单的指南来安装Docker。通过wget命令下载并运行安装脚本,提供了获取Docker安装脚本的链接以及查看Docker版本和信息的文档。
wget -qO- https://get.docker.com/ | sh

脚本: https://get.docker.com/


docker version

image.png

docker info


docs: https://docs.docker.com/install/linux/docker-ee/ubuntu/#install-from-a-package
image.png


### Ubuntu 22.04 Offline Installation Guide for Docker For an offline installation of Docker on Ubuntu 22.04, preparation is necessary both from a machine with internet access and the target system that lacks it. #### Preparing Packages on Internet-connected Machine Firstly, download all required packages along with their dependencies using `apt-get` commands. This process involves exporting these into `.deb` files which will later be transferred to the intended computer without web connectivity: ```bash sudo apt update && sudo apt upgrade -y mkdir ~/docker-offline-install cd ~/docker-offline-install apt-cache depends --recurse --pre-depends --depends \ --recommend --suggest --enhance docker-ce | grep "^\w" |\ grep -v "^docker-ce$" | sort -u > package-list.txt xargs -a package-list.txt -r sudo apt-get download ``` The above script creates a directory named `docker-offline-install`, navigates inside it, fetches dependency information about `docker-ce`, filters out unnecessary lines, sorts unique entries, writes them down as text file names `package-list.txt`. Finally, downloads each listed item based upon content within this document[^1]. #### Transferring Files to Target System Once downloaded, transfer all `.deb` files present in your created folder (`~/docker-offline-install`) via USB drive or any other preferred method onto another PC running same OS version but not connected online. #### Installing Docker Without Network Connection After copying over previously gathered binaries, switch terminal session towards new location containing those files then execute following instructions sequentially: ```bash sudo dpkg -i *.deb sudo usermod -aG docker $USER newgrp docker ``` These commands install every single binary located at current working directory while adding currently logged-in username under group 'docker'. The last line changes primary GID (Group ID) immediately after execution completes successfully so no logout/login cycle becomes mandatory hereafter. #### Verifying Successful Setup To ensure everything went smoothly during setup phase run below test case once done setting up environment properly according to aforementioned steps provided earlier: ```bash docker run hello-world ``` If message similar like one shown underneath appears afterward, congratulations! Your mission has been accomplished perfectly fine indeed! > Hello from Docker! > > This message shows that your installation appears to be working correctly. >
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值