加入收藏 | 设为首页 | 会员中心 | 我要投稿 武陵站长网 (https://www.50888.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Rocky Linux-0014-教程-贡献-本地文档-容器部署

发布时间:2022-12-12 14:02:31 所属栏目:Linux 来源:网络
导读: 0、背景
CentOS 8 已停止维护,Rocky Linux 是未来~
从本篇起翻译一下 Rocky Linux 贡献教程~
本篇翻译一下如何对洛基林纽克斯进行贡献。
(1)本系列文章
0010 之前的省略~ 可从 0011 里面

0、背景

CentOS 8 已停止维护,Rocky Linux 是未来~

从本篇起翻译一下 Rocky Linux 贡献教程~

本篇翻译一下如何对洛基林纽克斯进行贡献。

(1)本系列文章

0010 之前的省略~ 可从 0011 里面访问~

格瑞图:Rocky Linux-0011-教程-构建安装自定义内核-05

格瑞图:Rocky Linux-0012-教程-贡献-贡献教程-01

格瑞图:Rocky Linux-0013-教程-贡献-贡献教程-02

1、洛基文档歪脖站点本地部署 - Running a local copy of the docs.rockylinux.org website for web development and/or content authors?This document walks through how to recreate and run a local copy of the entire docs.rockylinux.org website on your local machine. It is a work-in-progress.

本文介绍如何在本地创建并运行整个官方文档 docs.rockylinux.org 站点。这是一个正在进行的工作。

Running a local copy of the documentation website might be useful in the following scenarios:

在本地运行一个文档站点的可能场景如下:

You are interested in learning about and contributing to the web development aspects of the docs.rockylinux.org website

01.对官方文档歪脖站点的学习和贡献感兴趣。

You are an author and you'd like to see how your documents will render/look on the docs website before contributing them

02.是一个作者并想在为文档歪脖站点贡献之前看看渲染展现效果。

You are a web developer looking to contribute to or help maintain the docs.rockylinux.org website

03.是一个歪脖研发人员想贡献或者帮助维护 docs.rockylinux.org 站点。

(1)注意 - Some notes:?The instructions in this guide are NOT a prerequisite for Rocky documentation Authors/Content contributors

本文档里的指引并不是洛基文档作者和内容贡献者的预备条件。

The entire environment runs in a Docker container and so you'll need a Docker engine on your local machine

整个环境运行在容器之内,因此本地机器上需要一个容器引擎。

The container is built on top of the official RockyLinux docker image available here hub.docker.com/r/rockylinux/rockylinux

在容器构建于官方洛基林纽克斯容器镜像之上linux 教程,可以从这里获取。

The container keeps the documentation content (guides, books, images and so on) separate from the web engine (mkdocs)

该容器将文档内容(教程、图书、图片等等)与歪脖引擎分开(mkdocs)。

The container starts a local web server listening on port 8000. And port 8000 will be forwarded to the Docker host

该镜像启动一个本地歪脖服务器并监听在端口八千。端口八千会将流量转发到容器主机。

(2)创建内容环境 - Create the content environment?Change the current working directory on your local system to a folder where you intend to do your writing. We'll refer to this directory as $ROCKYDOCS in the rest of this guide. For our demo here, $ROCKYDOCS points to ~/projects/rockydocs on our demo system.

01.切换当前工作目录到本地系统将要写文档的目录。后续使用 $R 引用该目录。对于示例,$R 指向的是示例系统的 ~/p/r。

Create $ROCKYDOCS if it doesn't already exist and then type:

如果目录不存在创建他,输入命令:

cd  $ROCKYDOCS

Make sure you have git installed (dnf -y install git). While in $ROCKYDOCS use git to clone the official Rocky Documentation content repo. Type:

02.确保安装了姬特(d -y i g)。在 $R 目录中执行姬特克隆官方洛基文档内容代码仓库。输入:

git clone https://github.com/rocky-linux/documentation.git

You'll now have a $ROCKYDOCS/documentation folder. This folder is a git repository and under git's control.

现在有了 $R/d 目录。这个目录是一个姬特代码仓库并在姬特管控之下。

(3)创建并启动 RD 歪脖开发环境 - Create and Start the RockyDocs web developmwnt environment?Make sure you have Docker up and running on your local machine (you can check with systemctl)

01.确保已经有容器环境并且启动了他(可以使用西斯特姆康愁检查)。

From a terminal type:

02.从命令行里输入:

docker pull wsoyinka/rockydocs:latest

Check to make sure the image downloaded successfully. Type:

03.确保镜像已经成功下载。输入:

docker image  ls

(4)启动 RD 容器 - Start the RockyDocs container?Start a container from the rockydocs image. Type:

使用 rd 镜像启动一个容器。输入:

docker run -it --name rockydoc --rm \
     -p 8000:8000  \
     --mount type=bind,source="$(pwd)"/documentation,target=/documentation  \
     wsoyinka/rockydocs:latest

Alternatively if you prefer and if you have docker-compose installed, you can create compose file named docker-compose.yml with the following contents:

或者说更稀饭使用 d-c 并安装了他,可以创建一个创作文件叫做 d-c.y 并录入以下内容:

version: "3.9"
services:
  rockydocs:
    image: wsoyinka/rockydocs:latest
    volumes:
      - type: bind
        source: ./documentation
        target: /documentation
    container_name: rocky
    ports:
       - "8000:8000"

Save the file with the file name docker-compose.yml in your $ROCKYDOCS working directory. And start the service/container by running:

使用文件名 d-c.y 保存该文件到 $R 工作目录。然后通过下面的命令启动服务或容器:

docker-compose  up

(5)预览本地官方文档歪脖站点 - View the local docs.rockylinux.org website?With the container up and running, you should now be able to point your web browser to the following URL to view your local copy of the site:

在容器启动并运行后,可以使用浏览器访问下面的地址来查看站点的本地拷贝:

:8000Last update: February 27, 2022

Author: Wale Soyinka

Contributors: Steve Spencer

最后更新:2022-02-27

(编辑:武陵站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!