root@ke666-PC:~# sudo add-apt-repository
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian
$(lsb_release -cs)
stable"
sudo: unable to execute /usr/bin/add-apt-repository: No such file or directory
按照那个连接的方法,
现在提示这个
sudo apt install docker.io #完事
最可靠的方法是看文档
最简单的方法就是等别人把文档复制到这里给你看
你直接去看 和别人看完发给你是一样的
created: 2024-06-17T09:53:01 (UTC +08:00)
tags: [binaries,installation,docker,documentation,linux,install,docker,engine]
source: https://docs.docker.com/engine/install/binaries/
author:
Install Docker Engine from binaries | Docker Docs
Excerpt
Learn how to install Docker as a binary. These instructions are most suitable for testing purposes.
Important
This page contains information on how to install Docker using binaries. These instructions are mostly suitable for testing purposes. We do not recommend installing Docker using binaries in production environments as they don't have automatic security updates. The Linux binaries described on this page are statically linked, which means that vulnerabilities in build-time dependencies are not automatically patched by security updates of your Linux distribution.
Updating binaries is also slightly more involved when compared to Docker packages installed using a package manager or through Docker Desktop, as it requires (manually) updating the installed version whenever there is a new release of Docker.
Also, static binaries may not include all functionalities provided by the dynamic packages.
On Windows and Mac, we recommend that you install Docker Desktop instead. For Linux, we recommend that you follow the instructions specific for your distribution.
If you want to try Docker or use it in a testing environment, but you're not on a supported platform, you can try installing from static binaries. If possible, you should use packages built for your operating system, and use your operating system's package management system to manage Docker installation and upgrades.
Static binaries for the Docker daemon binary are only available for Linux (as dockerd
) and Windows (as dockerd.exe
). Static binaries for the Docker client are available for Linux, Windows, and macOS (as docker
).
This topic discusses binary installation for Linux, Windows, and macOS:
- Install daemon and client binaries on Linux
- Install client binaries on macOS
- Install server and client binaries on Windows
Install daemon and client binaries on Linux
Prerequisites
Before attempting to install Docker from binaries, be sure your host machine meets the prerequisites:
- A 64-bit installation
- Version 3.10 or higher of the Linux kernel. The latest version of the kernel available for your platform is recommended.
iptables
version 1.4 or highergit
version 1.7 or higher- A
ps
executable, usually provided byprocps
or a similar package. - XZ Utils 4.9 or higher
- A properly mounted
cgroupfs
hierarchy; a single, all-encompassingcgroup
mount point is not sufficient. See Github issues #2683, #3485, #4568).
Secure your environment as much as possible
OS considerations
Enable SELinux or AppArmor if possible.
It is recommended to use AppArmor or SELinux if your Linux distribution supports either of the two. This helps improve security and blocks certain types of exploits. Review the documentation for your Linux distribution for instructions for enabling and configuring AppArmor or SELinux.
Security warning
If either of the security mechanisms is enabled, do not disable it as a work-around to make Docker or its containers run. Instead, configure it correctly to fix any problems.
Docker daemon considerations
- Enable
seccomp
security profiles if possible. See Enablingseccomp
for Docker. - Enable user namespaces if possible. See the Daemon user namespace options.
Install static binaries
-
Download the static binary archive. Go to https://download.docker.com/linux/static/stable/, choose your hardware platform, and download the
.tgz
file relating to the version of Docker Engine you want to install. -
Extract the archive using the
tar
utility. Thedockerd
anddocker
binaries are extracted. -
Optional: Move the binaries to a directory on your executable path, such as
/usr/bin/
. If you skip this step, you must provide the path to the executable when you invokedocker
ordockerd
commands. -
Start the Docker daemon:
If you need to start the daemon with additional options, modify the above command accordingly or create and edit the file
/etc/docker/daemon.json
to add the custom configuration options. -
Verify that Docker is installed correctly by running the
hello-world
image.This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
You have now successfully installed and started Docker Engine.
Tip
Receiving errors when trying to run without root?
The
docker
user group exists but contains no users, which is why you’re required to usesudo
to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.
Install client binaries on macOS
Note
The following instructions are mostly suitable for testing purposes. The macOS binary includes the Docker client only. It does not include the
dockerd
daemon which is required to run containers. Therefore, we recommend that you install Docker Desktop instead.
The binaries for Mac also do not contain:
- A runtime environment. You must set up a functional engine either in a Virtual Machine, or on a remote Linux machine.
- Docker components such as
buildx
anddocker compose
.
To install client binaries, perform the following steps:
-
Download the static binary archive. Go to https://download.docker.com/mac/static/stable/ and select
x86_64
(for Mac on Intel chip) oraarch64
(for Mac on Apple silicon), and then download the.tgz
file relating to the version of Docker Engine you want to install. -
Extract the archive using the
tar
utility. Thedocker
binary is extracted. -
Clear the extended attributes to allow it run.
Now, when you run the following command, you can see the Docker CLI usage instructions:
-
Optional: Move the binary to a directory on your executable path, such as
/usr/local/bin/
. If you skip this step, you must provide the path to the executable when you invokedocker
ordockerd
commands. -
Verify that Docker is installed correctly by running the
hello-world
image. The value ofis a hostname or IP address running the Docker daemon and accessible to the client.
This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
Install server and client binaries on Windows
Note
The following section describes how to install the Docker daemon on Windows Server which allows you to run Windows containers only. When you install the Docker daemon on Windows Server, the daemon doesn't contain Docker components such as
buildx
andcompose
. If you're running Windows 10 or 11, we recommend that you install Docker Desktop instead.
Binary packages on Windows include both dockerd.exe
and docker.exe
. On Windows, these binaries only provide the ability to run native Windows containers (not Linux containers).
To install server and client binaries, perform the following steps:
-
Download the static binary archive. Go to https://download.docker.com/win/static/stable/x86_64 and select the latest version from the list.
-
Run the following PowerShell commands to install and extract the archive to your program files:
-
Register the service and start the Docker Engine:
-
Verify that Docker is installed correctly by running the
hello-world
image.This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
Upgrade static binaries
To upgrade your manual installation of Docker Engine, first stop any dockerd
or dockerd.exe
processes running locally, then follow the regular installation steps to install the new version on top of the existing version.
Next steps
- Continue to Post-installation steps for Linux.
直接下载安装包安装即可
官网因为网络关系,可以用清华镜像下载:https://mirror.tuna.tsinghua.edu.cn/docker-ce/linux/debian/dists/bookworm/pool/stable/amd64/
root@ke666-PC:~# sudo add-apt-repository
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian
$(lsb_release -cs)
stable"
sudo: unable to execute /usr/bin/add-apt-repository: No such file or directory
按照那个连接的方法,
现在提示这个
我是只用这篇文章上的自动安装脚本就可以,不用下面的手动安装。只是不知道现在有没有网络问题
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
在Linux发行版上安装Docker的方法多种多样,不同的安装方法会带来不同的优点和缺点。下面将详细探讨在宣称自己不是基于Debian的Linux发行版上使用Debian方法安装Docker与直接使用官方推荐的二进制安装方法两者之间的优点和缺点:
-
兼容性
- 使用Debian方法安装Docker:可能会遇到包依赖问题,因为不是基于Debian的系统可能不具备Debian方法所需的特定包和库,这可能导致安装过程中出现不兼容的情况。
- 官方推荐的二进制安装方法:通常设计得更为通用,能更好地适应各种Linux发行版,从而减少兼容性问题。
-
系统稳定性
- 使用Debian方法安装Docker:若成功安装,由于Debian的稳定性,可能会带来一定程度的系统稳定性,但这也取决于Debian方法与系统的兼容性。
- 官方推荐的二进制安装方法:官方通常已经考虑到了系统稳定性的因素,会尽量减少对系统的干扰,以保持系统原有的稳定性。
-
系统资源消耗
- 使用Debian方法安装Docker:可能会引入额外的软件包和依赖,从而增加系统的资源消耗。
- 官方推荐的二进制安装方法:通常会尽量精简所需的组件,以降低系统资源消耗。
-
安装过程的复杂性
- 使用Debian方法安装Docker:可能需要解决包依赖问题,这会增加安装过程的复杂性。
- 官方推荐的二进制安装方法:设计时往往考虑到用户友好性,因此安装过程可能更简单直接。
-
安全性
- 使用Debian方法安装Docker:如果安装过程中需要从非官方源下载软件包,可能会带来安全风险。
- 官方推荐的二进制安装方法:通常提供安全保障,因为官方会签名二进制文件,确保其未被篡改。
-
更新和维护
- 使用Debian方法安装Docker:更新和维护可能需要手动解决依赖关系,增加了维护成本。
- 官方推荐的二进制安装方法:更新和维护通常更为简单,因为官方会提供相应的工具和指南。
-
社区支持
- 使用Debian方法安装Docker:可能不会得到官方社区的全面支持,因为这种方法可能不是官方推荐的。
- 官方推荐的二进制安装方法:可以获得官方和社区的广泛支持,这对于解决问题非常有帮助。
-
软件包的更新频率
- 使用Debian方法安装Docker:软件包的更新可能会滞后,因为需要适应非Debian系统。
- 官方推荐的二进制安装方法:官方通常会提供最新版本的软件,更新频率更高。
总的来说,用户在选择安装Docker的方法时,应该考虑自己系统的特点以及上述提到的优缺点,以确保选择最适合自己环境的安装方法。同时,无论选择哪种方法,都需要关注安装后的维护和更新,以确保Docker环境的稳定运行。
sudo apt install docker.io #完事
没错,就按这个人说的做,别听那些让专门加源的建议。
请问各位大佬,deepinv23的rc2版本如何安装docker