DAY2 安装 Docker

DAY 2

今天要来安装kubernetes,不过在安装k8s前我们需要先装docker,有关docker的介绍可以参考之前的文章:Day2 浅谈Docker-虚拟机器和容器的差别,以下我们直接进入docker的安装步骤。

Docker 安装步骤

1.更新apt并安装软件包用来通过HTTPS获取存储库

apt-get update
apt-get install -y apt-transport-https \
   ca-certificates \
   curl \
   gnupg-agent \
   software-properties-common

2.加入Docker的官方GPG密钥

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

3.设定稳定版本的存储库

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

4.更新apt,安装最新版本的Docker Engine-Community和Containerd

apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io

5.测试Docker是否安装成功,输入以下指令,出现以下讯息则安装成功

$ sudo docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:61bd3cb6014296e214ff4c6407a5a7e7092dfa8eefdbbec539e133e97f63e09f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

明天再来装kubernetes,又过一天:)


<<:  Day2 用python写UI-聊聊tkinter的基本操作~

>>:  Day05 - 端到端(end-to-end)语音辨识-CTC part 1

Day 12: 人工智慧在音乐领域的应用 (机器学习/深度学习与类神经网路三)

今天作为机器学习这系列的收尾,我们来聊聊深度学习与机器学习的差异,以及为什麽现今的机器学习/深度学习...

Day4:如何使用Parrot_Security的CeWL工具收集特定网站的Wordlist

今天我们来讲一下如何使用Parrot_Security的CeWL工具来收集特定网站的Wordlist...

Day14 资料汇入和汇出

接下来我们来说明一下,在kibana要怎麽汇出和汇入查询资料?在实际的业务中,大家多少都有汇入、汇出...

Day22-"气泡排序法"

我们一般会将需要排序的资料存放在阵列中,因此今天要介绍气泡排序演算法的目标就阵列资料的结构。 气泡排...

资料库正规化说明(Day11)

目的 1.降低资料重复性(Data Redundancy) 2.避免资料更新异常(Anomalies...