debian安装docker命令(debian安装docker-compose)

debian安装docker命令(debian安装docker-compose)

扫码添加渲大师小管家,免费领取渲染插件、素材、模型、教程合集大礼包!

大家好,今天来介绍debian安装docker命令(debian10安装docker)的问题,以下是渲大师小编对此问题的归纳和整理,感兴趣的来一起看看吧!

debian 9 stretch安装docker

1.卸载历史docker

sudo apt-get remove docker docker-engine docker.io

2. 更新apt-get源

sudo apt-get update

3.安装软件包改闷老让罩肆apt支持HTTPS

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

4.添加docker官方GPG KEY

curl -fsSL https://download.docker.com/linux/$(. /etc/os-release;echo"$ID")/gpg sudo apt-key add -

5.指纹核升验证

sudo apt-key fingerprint 0EBFCD88

是否是:9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88

6.添加apt镜像仓库

x86_64 :

sudo add-apt-repository\"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release;echo"$ID")\$(lsb_release -cs)\stable"

armhf :

echo"deb [arch=armhf] https://download.docker.com/linux/$(. /etc/os-release;echo"$ID")\$(lsb_release -cs)stable"\sudo tee /etc/apt/sources.list.d/docker.list

7.安装docker CE(Docker 从 17.03版本之后分为 CE(Community Edition) 和 EE(Enterprise Edition))

sudo apt-get update

sudo apt-get install docker-ce

debian 8 怎么安装Docker

https://docs.docker.com/engine/installation/linux/debian/#debian-jessie-80-64-bit

一般这类软件官网都有FAQ的敏扰。还有碧拿敏看官网的user guide

英文安装过程悔枝如下:

Debian

Docker is supported on the following versions of Debian:

Debian testing stretch (64-bit)

Debian 8.0 Jessie (64-bit)

Debian 7.7 Wheezy (64-bit)(backports required)

Note: If you previously installed Docker usingAPT, make sure you update yourAPTsources to the newAPTrepository.

Prerequisites

Docker requires a 64-bit installation regardless of your Debian version. Additionally, your kernel must be 3.10 at minimum. The latest 3.10 minor version or a newer maintained version are also acceptable.

Kernels older than 3.10 lack some of the features required to run Docker containers. These older versions are known to have bugs which cause data loss and frequently panic under certain conditions.

To check your current kernel version, open a terminal and useuname -rto display your kernel version:

$ uname -r

Additionally, for users of Debian Wheezy, backports must be available. To enable backports in Wheezy:

Log into your machine and open a terminal withsudoorrootprivileges.

Open the/etc/apt/sources.list.d/backports.listfile in your favorite editor.

If the file doesn’t exist, create it.

Remove any existing entries.

Add an entry for backports on Debian Wheezy.

An example entry:

deb http://http.debian.net/debian wheezy-backports main

Update package information:

$ apt-get update

Update your apt repository

Docker’sAPTrepository contains Docker 1.7.1 and higher. To setAPTto use from the new repository:

If you haven’t already done so, log into your machine as a user withsudoorrootprivileges.

Open a terminal window.

Purge any older repositories.

$ apt-get purge "lxc-docker*"
$ apt-get purge "docker.io*"

Update package information, ensure that APT works with thehttpsmethod, and that CA certificates are installed.

$ apt-get update
$ apt-get install apt-transport-https ca-certificates

Add the newGPGkey.

$ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Open the/etc/apt/sources.list.d/docker.listfile in your favorite editor.

If the file doesn’t exist, create it.

Remove any existing entries.

Add an entry for your Debian operating system.

The possible entries are:

Note: Docker does not provide packages for all architectures. To install docker on a multi-architecture system, add an[arch=...]clause to the entry. Refer to theDebian Multiarch wikifor details.

On Debian Wheezy

deb https://apt.dockerproject.org/repo debian-wheezy main

On Debian Jessie

deb https://apt.dockerproject.org/repo debian-jessie main

On Debian Stretch/Sid

deb https://apt.dockerproject.org/repo debian-stretch main

Save and close the file.

Update theAPTpackage index.

$ apt-get update

Verify thatAPTis pulling from the right repository.

$ apt-cache policy docker-engine

From now on when you runapt-get upgrade,APTpulls from the new apt repository.

Install Docker

Before installing Docker, make sure you have set yourAPTrepository correctly as described in the prerequisites.

Update theAPTpackage index.

$ sudo apt-get update

Install Docker.

$ sudo apt-get install docker-engine

Start thedockerdaemon.

$ sudo service docker start

Verifydockeris installed correctly.

$ sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message. Then, it exits.

Giving non-root access

Thedockerdaemon always runs as therootuser and thedockerdaemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the userroot, and so, by default, you can access it withsudo.

If you (or your Docker installer) create a Unix group calleddockerand add users to it, then thedockerdaemon will make the ownership of the Unix socket read/writable by thedockergroup when the daemon starts. Thedockerdaemon must always run as the root user, but if you run thedockerclient as a user in thedockergroup then you don’t need to addsudoto all the client commands. From Docker 0.9.0 you can use the-Gflag to specify an alternative group.

Warning: Thedockergroup (or the group specified with the-Gflag) isroot-equivalent; seeDocker Daemon Attack Surfacedetails.

Example:

# Add the docker group if it doesn't already exist.
$ sudo groupadd docker

# Add the connected user "${USER}" to the docker group.
# Change the user name to match your preferred user.
# You may have to logout and log back in again for
# this to take effect.
$ sudo gpasswd -a ${USER} docker

# Restart the Docker daemon.
$ sudo service docker restart

Upgrade Docker

To install the latest version of Docker withapt-get:

$ apt-get upgrade docker-engine

Uninstall

To uninstall the Docker package:

$ sudo apt-get purge docker-engine

To uninstall the Docker package and dependencies that are no longer needed:

$ sudo apt-get autoremove --purge docker-engine

The above commands will not remove images, containers, volumes, or user created configuration files on your host. If you wish to delete all images, containers, and volumes run the following command:

$ rm -rf /var/lib/docker

You must delete the user created configuration files manually.

如果你用apt 请先更新apt

docker 支持64位debain .内核最低必须是3.10的。

可以用 uname -r 命令查看系统和内核版本

Debian11安装docker

获取加速服务方法

需要将哗段姿乱绝当前用户加入 docker 用户燃旁组,否则进行相关操作会提示没有权限,也不建议使用 root 身份来操作docker

至此,docker安装完成。

Docker容器中安装Docker

最近用到Jenkins,使用了Docker来提供服务,但是在构建步骤中又希望能够使用Docker去生成镜像,因此需要实现在Docker容器中去安装Docker,其实也就是在特定的系统环境下安装Docker,但是实际操作中可能还会出现其吵扒他问题。
以Jenkins/Jenkins容器为例子。
进入jenkins容器:

一般安装前都需要知道当前系统信息,没有安装lsb-core,因此执行:

我在第一次查询时候也看不出来是用的哪个系统以及版本,猜测应该为Debian。

因为原来的配置的源速度太慢(无效?),因此执行apt-get update都会失败,所以无法去安装新的软件。所以需要先更改源配置,这个过程中我找到了不少配置信息,但是基本都因为key过期等原因不能够使用。这里洞山推荐一个很好的网站,会每隔四小时发纳碰中布Debian的源地址:

备份Linux的源配置文件:

修改源配置信息(因为没有安装vim,只能通过>方式将地址写入文件)

然后安装vim,方便后面查看等操作。

编辑sources.list 文件,配置完整地址。

同样安装lsb-core,安装完成后可以使用lsb_release -a查看系统版本。

接下来就是安装Docker,这里我们已经知道是在Debian环境下安装Docker,可以参考菜鸟的步骤:

Debian11最小化部署k8s集群

查看 安装 kubeadm-准备工作 对 k8s 安装的基本要求:

( 整个部署环境全在virtualbox中实现 )
部署最小化 K8S 集群:master + node1 + node2

3台主机IP分别为 192.168.36.213 、 192.168.36.141 、 192.168.36.188 、,将起配置到 文件中,保证互相合一通:

确保 br_netfilter 模块被加载。这一操作可以通过运行 lsmod grep br_netfilter 来完成。若要显式加载该模块,可执行 sudo modprobe br_netfilter 。

为了让你的 Linux 节点上的 iptables 能够正确地查看桥接流量,你需要确保在你的 sysctl 配置中将 net.bridge.bridge-nf-call-iptables 设置为 1 :

参见 Debian11安装docker

参考 安装-kubeadm-kubelet-和-kubectl

防止版本误差太大出问题,锁定版本

添加开机启动虚纯

---------------以上使用 master 节点进行演示查看,其他节点操作均一致--------------------

在 master(192.168.36.213)节点上执行:
kubeadm init 命令参考

上面安装完后,会提示你输入如下命令,按顺序执行即可。

在 ndoe 节点分别执行这个命令:

默认 token 有效期差基咐为24小时,当过期之后,该token就不可用了。这时就需要重新创建 token ,操作如下:

上述操作成功之后回到 Master 节点,运行 kubectl get nodes 命令查看:

此时,虽然 Maste 节点可以检测到 node 节点,但 STATUS 都还是 NotReady 状态,这里需要看装 CNI节点来实现网络访问。 Kubernetes 的网络模型选择 :

各个节点状态已就绪

至此,一个简单的锋旁 k8s 集群系统安装、测试完成。

分享到 :
相关推荐

境外vps租用如何选择(租国外服务器搭vps)

境外vps租用选择的方法:1。不选择免费的境外vps主机。质量上没有保证。主机的安全...

tomcat安装步骤(tomcat怎么安装到eclipse)

大家好,今天来介绍tomcat安装步骤(tomcat安装及配置教程idea)的问题,...

使用国内免费cdn服务器对网站有哪些好处

使用国内免费cdn服务器对网站的好处有:1。能为用户解决服务器配置。独立带宽。南北双...

直播行业选择香港专用服务器有哪些好处(直播行业选择香港专用服务器有哪些好处呢)

直播行业选择香港专用服务器的好处有:1。硬件配置支持定制化。能满足直播行业的配置需求...

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注