Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

百技2组中英文文档 #15

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 基于 VirtualBox + CentOS7 的 PouchContainer 体验环境搭建与上手指南

## 下载VirtualBox

**1. 阿里郎-管家-办公软件管理 安装 VirtualBox,默认版本为 5.2.12**

**2. 在钉盘上下载 VirtualBox**

- Mac 版本地址: https://space.dingtalk.com/s/gwHOABma4QLOGlgkPQPaACBiMzk5ZWRjZTAyO GI0MTBkOGRkNTRjYzNkN2Q1NTFjOA 密码: p5Sb
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't show the password in the public repo...... this is the rule. please

- Windows 版本地址: https://space.dingtalk.com/s/gwHOABmLzwLOGlgkPQPaACBhNzNjYjI5NTYxM zQ0NmUwOWRmMTFlN2UzMTYxNDQ4Mw 密码: V7ms

## 配置虚拟机

**1. 下载开发环境的虚拟机备份,钉盘地址:**

https://space.dingtalk.com/s/gwHOABmLxALOGlgkPQPaACA4N2JjNmIwMGI5N WU0MGE1YjZhNTBiOGNjMDZhOTJiNQ 密码: pLgb

**2. 打开 VirtualBox**

- 新建-名称自定义-类型选择【Linux】-版本选择【Red Hat(64- bit)】

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142367376-58af5f86-e7e1-452e-aee3-cce1489a1a92.png" width="450px" height="300px" />

- 内存选择【1024M】

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142356237-1525281e-6fbd-4dfa-b359-8f10f9720ef6.png" width="450px" height="300px" />

- 使用【已有的虚拟硬盘文件】-选择步骤 1 中下载的 vdi 文件-创建

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142341940-d29a6743-c8e5-4581-adda-4e4f1149f1d2.png" width="450px" height="300px" />

**3. 启动新建实例,等待进入到登录阶段,用户名 `root`,密码 `Ali88Baiji `**

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142322664-3227342d-fa41-48b3-834e-3aa46b8446a2.png" width="700px" height="150px" />

**4. 修改`/etc/sysconfig/network-scripts/ifcfg-eth0`,使其中的 HWADDR 与 ip ad 命令中显示的 MAC 地址一致,reboot 后 ping www.alibaba-inc.com,检查网络是否正常**

- ip ad 命令查看MAC地址

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142281019-3a911e83-76fb-47e9-b11e-3d97a960fbd7.png" width="700px" height="400px" />

- 修改`/etc/sysconfig/network-scripts/ifcfg-eth0`中HWADDR

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142305340-0966e48f-2bdc-492a-8277-791a92c62e0f.png" width="700px" height="130px" />

- ping www.alibaba-inc.com,检查网络连接

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142294988-03c54bb0-6778-4fb1-b149-9f5fa3e1122e.png" width="700px" height="200px" />

## 运行PouchContainer

1. 执行 `systemctl start pouch`, 启动 pouch 服务
2. 执行 `pouch run -t -d busybox sh`, 启动一个 busybox 基础容器
3. 执行 `pouch exec -it {ID} sh` 登入启动的容器,其中 ID 是上条命令输出的完整 ID 中的前六位

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142287443-e03b22c0-06d9-48ab-a13f-ea8b6718877d.png" width="700px" height="100px" />

## 配置sshd

**1. 在VirtualBox中设置网卡,选择仅主机(Host-Only)适配器的方式**

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142079098-7c0cc1d6-3d78-4194-8d44-5cbc6e7ff2bb.png" width="450px" height="250px" />

**2. 在虚拟机中修改sshd配置,允许远程连接**

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142261139-1571f8f5-cc5a-4610-963c-b4930a16b69c.png" width="550px" height="300px" />

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531143160892-bf7a520c-fc96-40b6-a9bf-d4286c9673ca.png" width="550px" height="300px" />

**3. 重启sshd服务:`systemctl restart sshd.service `**

**4. 查看虚拟机IP地址:`ip addr `**

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142232272-1d4b4cb6-623a-4336-8b41-e8568458814d.png" width="450px" height="300px" />

**5. 在宿主机中通过iTerm连接虚拟机**

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531143146304-720f9ef3-1031-4b73-aa60-250c44c41c26.png" width="700px" height="150px" />

## 将宿主机pouch目录挂载到虚拟机中

**1. 在VirtualBox中设置共享文件夹**

<img src="https://cdn.yuque.com/lark/0/2018/png/72820/1531142079098-7c0cc1d6-3d78-4194-8d44-5cbc6e7ff2bb.png" width="500px" height="300px" />

**2. 在虚拟机中执行以下命令安装挂载所需模块**

```
yum clean all
yum update
yum install kernel
yum install kernel-devel
yum install kernel-headers
yum install gcc
yum install make
reboot
cd /opt/VBoxGuestAdditions-*/init
./vboxadd setup
reboot
```

**3. 执行` mount -t vboxsf pouchShare /root/go/src/github.com/alibaba/pouch`,将添加的共享文件夹挂载到虚拟机的pouch源码路径下**

231 changes: 231 additions & 0 deletions blog-cn/安装说明.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# 快速入门

总共提供了两个快速入门,一个用于终端用户,另一个用于开发人员。

希望使用PouchContainer的终端用户,请阅读 [终端用户快速入门](#终端用户快速入门)以安装和探索PouchContainer。

希望开发PouchContainer的开发人员,请阅读[开发人员快速入门](#开发人员快速入门)以开始开发并参与项目!

## <div id="终端用户快速入门">终端用户快速入门</div>

只需很少的步骤,您就可以在您的机器上自动安装PouchContainer。目前我们支持两种Linux发行版:Ubuntu和CentOS。

### Ubuntu

要安装PouchContainer,您需要一个Ubuntu 16.04(Xenial LTS)在维护的版本。不支持存档和测试版本。

PouchContainer与Docker冲突,因此您必须在安装PouchContainer之前卸载Docker。

**准备工作**

PouchContainer支持LXCFS以提供强隔离,因此您应首先安装LXCFS。默认情况下,LXCFS是被启用的。

``` bash
sudo apt-get install lxcfs
```

安装下列包以允许'apt'通过HTTPS使用仓库:

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

**1. 添加PouchContainer的官方GPG密钥**

``` bash
curl -fsSL http://mirrors.aliyun.com/opsx/pouch/linux/debian/[email protected] | sudo apt-key add -
```

通过搜索指纹的最后8个字符,验证您现在是否具有指纹 `F443 EDD0 4A58 7E8B F645 9C40 CF68 F84A BE2F 475F`的密钥。

``` bash
$ apt-key fingerprint BE2F475F
pub 4096R/BE2F475F 2018-02-28
Key fingerprint = F443 EDD0 4A58 7E8B F645 9C40 CF68 F84A BE2F 475F
uid opsx-admin <[email protected]>
```

**2. 建立PouchContainer仓库**

在新主机上首次安装PouchContainer之前,您需要建立PouchContainer仓库。我们默认启用了`stabel` 仓库,因为您始终需要`stabel` 仓库。要添加 `test` 仓库,请在以下命令行中的单词 `stable` 之后添加单词 `test` 。在此之后,您可以从仓库安装和更新PouchContainer。

``` bash
sudo add-apt-repository "deb http://mirrors.aliyun.com/opsx/pouch/linux/debian/ pouch stable"
```

**3. 安装PouchContainer**

安装最新版本的PouchContainer。

``` bash
# update the apt package index
sudo apt-get update
sudo apt-get install pouch
```

安装PouchContainer后,将创建 `pouch` 组,但该组中未添加任何用户。

**4. 启动PouchContainer**

``` bash
sudo service pouch start
```

在此之后,您可以拉取一个镜像并运行PouchContainer容器。

### CentOS

要安装PouchContainer,您需要一个CentOS 7在维护的版本。不支持存档和测试版本。

我们已将rpm包放到Aliyun镜像中,您可以使用PouchContainer仓库安装PouchContainer。如果您在一台新主机上第一次安装PouchContainer,则需要建立PouchContainer仓库。然后,您可以从仓库安装和更新PouchContainer。

**1. 安装yum-utils**

安装所需的包。 yum-utils提供了yum-config-manager的实用工具。

``` bash
sudo yum install -y yum-utils
```

**2. 建立PouchContainer仓库**

使用以下命令添加PouchContainer仓库。

``` bash
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/opsx/opsx-centos7.repo
sudo yum update
```

注意:上述命令设置了 `stable` 仓库,您可以通过以下命令启用 `test` 仓库。

``` bash
sudo yum-config-manager --enable pouch-test
```

您可以通过运行 `yum-config-manager` 命令和 `--disable` 参数来禁用 `test` 仓库。要重新启用它,请使用 `--enable` 参数。使用以下命令可以禁用 `test` 仓库。

``` bash
sudo yum-config-manager --disable pouch-test
```

**3. 安装PouchContainer**

运行以下命令以安装最新版本的PouchContainer。如果您是第一次在您的主机上安装PouchContainer,系统将提示您接受GPG密钥,并显示密钥的指纹。

``` bash
sudo yum install pouch
```

安装PouchContainer后,将创建 `pouch` 组,但该组中未添加任何用户。

**4. 启动PouchContainer**

``` bash
sudo systemctl start pouch
```

在此之后,您可以拉取一个镜像并运行PouchContainer容器。

## 卸载pouch

在Ubuntu上卸载

``` bash
sudo apt-get purge pouch
```

在CentOS上卸载

``` bash
sudo yum remove pouch
```

运行 `remove` 命令后,您主机上的镜像,容器,存储卷和自定义配置文件不会被自动删除。若要删除所有镜像,容器和存储卷,请执行以下命令:

``` bash
sudo rm -rf /var/lib/pouch
```

## <div id="开发人员快速入门">开发人员快速入门</div>

本指南提供了在裸机服务器或虚拟机上部署PouchContainer的步骤说明。作为开发人员,您需要通过源代码构建和测试PouchContainer二进制文件。要构建被称为"PouchContainer Daemon"的pouchd和被称为"PouchContainer CLI"的pouch,需要安装以下系统依赖项:

* Linux Kernel 3.10+
* Go 1.9.0+
* containerd: 1.0.3
* runc: 1.0.0-rc4
* runv: 1.0.0 (option)


### 预安装

由于pouchd是一种容器引擎,而pouch是一个CLI工具,如果您希望通过pouch体验容器的管理能力,还需要几个额外的二进制文件:

* [containerd](https://github.com/containerd/containerd): 行业标准的容器运行时环境;
* [runc](https://github.com/opencontainers/runc): 用于根据OCI规范生成和运行容器的CLI工具;
* [runv](https://github.com/hyperhq/runv): 基于监管服务的OCI运行时环境;

以下是安装 `containerd` 和runc的shell脚本:

``` shell
# install containerd
$ wget https://github.com/containerd/containerd/releases/download/v1.0.3/containerd-1.0.3.linux-amd64.tar.gz
$ tar -xzvf containerd-1.0.3.linux-amd64.tar.gz -C /usr/local
$
# install runc
$ wget https://github.com/opencontainers/runc/releases/download/v1.0.0-rc4/runc.amd64 -P /usr/local/bin
$ chmod +x /usr/local/bin/runc.amd64
$ mv /usr/local/bin/runc.amd64 /usr/local/bin/runc
```

### runV安装

如果您希望额外体验基于监管服务的虚拟化,您需要安装[runV](https://github.com/hyperhq/runv)。

有关使用runV体验PouchContainer的更多指南,包括runv安装,请参考[PouchContainer run with runv guide](docs/features/pouch_with_runV.md)。

### PouchContainer的构建和安装

安装完所有依赖后,您可以构建和安装PouchContainer Daemo和PouchContainer CLI。克隆仓库并检出任意您选择的分支(在以下示例中,检出的是主干分支):

``` shell
mkdir -p $GOPATH/src/github.com/alibaba/
cd $GOPATH/src/github.com/alibaba/; git clone https://github.com/alibaba/pouch.git
cd pouch; git checkout master
```

名为 `build` 的Makefile target将编译当前工作目录中的pouch和pouchd二进制文件。或者您可以执行 `make install` 来构建二进制文件并将它们安装在目标目录中(默认情况下为 `/usr/local/bin` )。

``` shell
make install
```

### 启动PouchContainer
安装了所有需要的二进制文件后,您可以通过以下方式启动pouchd:

``` shell
$ pouchd
INFO[0000] starting containerd module=containerd revision=773c489c9c1b21a6d78b5c538cd395416ec50f88 version=v1.0.3
INFO[0000] setting subreaper... module=containerd
INFO[0000] loading plugin "io.containerd.content.v1.content"... module=containerd type=io.containerd.content.v1
INFO[0000] loading plugin "io.containerd.snapshotter.v1.btrfs"... module=containerd type=io.containerd.snapshotter.v1
WARN[0000] failed to load plugin io.containerd.snapshotter.v1.btrfs error="path /var/lib/containerd/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" module=containerd
INFO[0000] loading plugin "io.containerd.snapshotter.v1.overlayfs"... module=containerd type=io.containerd.snapshotter.v1
INFO[0000] loading plugin "io.containerd.metadata.v1.bolt"... module=containerd type=io.containerd.metadata.v1
WARN[0000] could not use snapshotter btrfs in metadata plugin error="path /var/lib/containerd/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" module="containerd/io.containerd.metadata.v1.bolt"
INFO[0000] loading plugin "io.containerd.differ.v1.walking"... module=containerd type=io.containerd.differ.v1
INFO[0000] loading plugin "io.containerd.grpc.v1.containers"... module=containerd type=io.containerd.grpc.v1
```

在pouchd运行之后,您可以通过PouchContainer CLI与pouchd进行交互:

```bash
$ pouch images
IMAGE ID IMAGE NAME SIZE
3e8fa85ddfef docker.io/library/busybox:latest 2699
504cf109b492 docker.io/library/redis:alpine 2035
```

## 反馈

我们希望本指南可以帮助您使用和运行PouchContainer。如果您有任何疑问,请随时通过[ISSUE](https://github.com/alibaba/pouch/issues/new)发送反馈。如果您希望在本指南中为PouchContainer做出贡献,请提交PR。
26 changes: 26 additions & 0 deletions blog-cn/附加翻译.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 路线图

路线图提供了PouchContainer决定优先排序的项目的详细说明。这有助于PouchContainer的贡献者更多地了解不断发展的方向以及一个潜在的贡献是否偏离了方向。

如果一个功能未被列出,并不意味着我们永远不会考虑它。我们一直热情欢迎所有的贡献。请理解,对此类贡献,提交者可能需要一些更多的时间进行审核。

我们在路线图中设计了三个部分:

* 容器常规管理
* 强隔离
* 向生态系统开放


## 容器常规管理

我们的第一要素是优化用户在容器管理方面的体验。[Moby](https://github.com/moby/moby)在业界中推广了容器API标准。并且PouchContainer将遵循此API标准来提供容器服务。此外,PouchContainer将更多地关注如何在各种隔离单元之上运行容器等方面。涉及应用程序方面更好的体验也在此范围之内。

## 强隔离

业界在提高容器安全性方面已经做了很多工作。但容器技术尚未达到目标。无论是在软件方面还是在硬件方面,PouchContainer将在强隔离方面做出更多的努力。由于安全性是技术应用于生产环境的最大障碍,PouchContainer将在以下领域提高隔离性:隔离资源的用户空间LXCFS,基于监管服务程序的容器,基于kvm的容器等。

## 生态系统的增强

为了对容器生态系统开源,PouchContainer被设计为可扩展的。作为一个容器引擎,PouchContainer将支持pod并能够集成更上层的编排层与[kubernetes](https://github.com/kubernetes/kubernetes)。对于基础架构管理,PouchContainer将采用[CNI](https://github.com/containernetworking/cni)和[CSI](https://github.com/container-storage-interface)。在监控、日志等方面,PouchContainer则扮演了一个开放性的角色,使自身更加接近云原生。


Loading