feat: upgrade to vp2

pull/498/head
Mr.Hope 2022-03-14 01:10:04 +08:00
parent 18028b8eaa
commit 7a339a8b42
9 changed files with 400 additions and 479 deletions

View File

@ -66,21 +66,18 @@ jobs:
PCIT_MESSAGE: Build from yeasy/docker_practice@${{github.sha}} PCIT_MESSAGE: Build from yeasy/docker_practice@${{github.sha}}
PCIT_TARGET_BRANCH: master PCIT_TARGET_BRANCH: master
PCIT_USERNAME: khs1994 PCIT_USERNAME: khs1994
- name: vuepress
- name: Build with VuePress
run: | run: |
sudo rm -rf _book sudo rm -rf _book
# npm i vuepress --save-dev
npm i npm i
git clone https://github.com/docker-practice/.vuepress .vuepress2 # git clone https://github.com/docker-practice/.vuepress .vuepress2
cp -r .vuepress2/. .vuepress/ # cp -r .vuepress2/. .vuepress/
rm -rf .vuepress2 # rm -rf .vuepress2
find . \( -path "./mesos" -o -path "./swarm_mode" -o -path "./node_modules" -o -path "./.vuepress" -o -path "./_book" -o -path "./CHANGELOG.md" -o -path "./CONTRIBUTING.md" \) -prune -o -name "*.md" -exec sed -i 'N;2a\<AdSenseTitle/>\n' {} \; # find . \( -path "./mesos" -o -path "./swarm_mode" -o -path "./node_modules" -o -path "./.vuepress" -o -path "./_book" -o -path "./CHANGELOG.md" -o -path "./CONTRIBUTING.md" \) -prune -o -name "*.md" -exec sed -i 'N;2a\<AdSenseTitle/>\n' {} \;
npx vuepress --version
npm run vuepress:build npm run vuepress:build
# echo "vuepress.docker-practice.com" > .vuepress/dist/CNAME
echo "vuepress.mirror.docker-practice.com" > .vuepress/dist/CNAME echo "vuepress.mirror.docker-practice.com" > .vuepress/dist/CNAME
cp -r _images .vuepress/dist cp -r _images .vuepress/dist
@ -98,6 +95,7 @@ jobs:
cp -r underly/_images .vuepress/dist/underly cp -r underly/_images .vuepress/dist/underly
echo "include: [_images]" > .vuepress/dist/_config.yml echo "include: [_images]" > .vuepress/dist/_config.yml
- name: Upload Vuepress dist - name: Upload Vuepress dist
uses: docker://pcit/pages uses: docker://pcit/pages
if: github.repository == 'docker-practice/docker_practice' if: github.repository == 'docker-practice/docker_practice'

6
.gitignore vendored
View File

@ -7,7 +7,13 @@ _book/
*.edx *.edx
.DS_Store .DS_Store
!.vuepress/
.vuepress/.cache/
.vuepress/.temp/
.vuepress/dist/
node_modules/ node_modules/
package-lock.json package-lock.json
yarn.lock
docker-compose.override.yml docker-compose.override.yml

View File

@ -1,3 +0,0 @@
/*
!.gitignore
!config.js

View File

@ -1,462 +0,0 @@
const { config } = require('vuepress-theme-hope')
module.exports = config({
title: 'Docker ',
base: '/',
head: [['script', {}, `
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?81a3490c9cd141dbcf6d00bc18b6edae";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`],
[
'script', {}, `
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
`
]
],
plugins: {
// sitemap: {
// hostname: 'https://vuepress.mirror.docker-practice.com'
// },
// 'git-log': {
// additionalArgs: '--no-merge',
// onlyFirstAndLastCommit: true,
// },
},
locales: {
"/": {
lang: "zh-CN"
}
},
themeConfig: {
blog: false,
// comment: false,
comment: {
type: "disable", // 使用 Valine
appId: "...", // your appId
appKey: "...", // your appKey
},
pageInfo: [
// 'author',
'reading-time',
'word',
],
footer: {
content: "Made with <a target='_blank' href='https://github.com/vuepress-theme-hope/vuepress-theme-hope'>vuepress-theme-hope</a>",
display: true,
copyright: false,
},
searchPlaceholder: 'Search',
repo: 'yeasy/docker_practice',
repoLabel: 'GitHub',
repoDisplay: true,
hostname: 'https://vuepress.mirror.docker-practice.com',
// author: 'yeasy',
mdEnhance: {
lineNumbers: true,
},
git: {
contributor: false,
},
themeColor: {
blue: '#2196f3',
// red: '#f26d6d',
// green: '#3eaf7c',
// orange: '#fb9b5f'
},
locales: {
"/": {
lang: "zh-CN"
}
},
darkmode: 'auto-switch',
//
showAds: true,
docsRepo: 'yeasy/docker_practice',
docsDir: '/',
docsBranch: 'master',
editLinks: true,
nav: [
{
text: '',
link: 'https://docker_practice.gitee.io/pic/dpsig-wechat.jpg',
},
{
text: '',
link: 'https://docker_practice.gitee.io/pic/dp-wechat-miniprogram.jpg',
},
{
text: ' Docker',
link: '/install/',
},
{
text: 'Docker ',
link: '/'
},
{
text: 'Docker ',
link: '/cases/os/'
},
{
text: 'CI/CD',
link: '/cases/ci/'
},
{
text: 'Compose',
link: '/compose/',
},
{
text: 'Kubernetes',
link: '/kubernetes/',
},
{
text: "云计算",
link: "/cloud/",
},
// {
// text: 'GitHub',
// link: 'https://github.com/yeasy/docker_practice'
// },
// {
// text: '捐赠',
// link: ''
// },
{
text: '99/',
link: 'https://cloud.tencent.com/act/cps/redirect?redirect=1062&cps_key=3a5255852d5db99dcd5da4c72f05df61&from=console'
},
// {
// text: '语言',
// items: [{
// text: 'English',
// link: ''
// }]
// }
],
sidebar: {
'/cloud/': [
'intro',
'tencentCloud',
'alicloud',
'aws',
'summary',
],
'/kubernetes/': [
'intro',
'concepts',
'design',
{
title: "部署 Kubernetes",
collapsable: true,
children: [
"setup/",
"setup/kubeadm",
"setup/docker-desktop",
"setup/systemd",
"setup/dashboard",
]
},
{
title: "Kubernetes 命令行 kubectl",
collapsable: true,
children: [
'kubectl/'
]
}
],
'/compose/': [
'introduction',
'v2',
'install',
'usage',
'commands',
'compose_file',
'django',
'rails',
'wordpress',
'lnmp',
],
'/install/': [
'ubuntu',
'debian',
'fedora',
'centos',
'raspberry-pi',
// 'offline',
'mac',
'windows',
'mirror',
'experimental',
],
'/cases/os/': [
{
title: "操作系统",
collapsable: false,
children: [
'busybox',
'alpine',
'debian',
'centos',
'summary',
],
},
{
title: "在 IDE 中使用 Docker",
collapsable: false,
children: [
'/ide/',
'/ide/vsCode',
],
},
],
'/cases/ci/': [
'actions/',
{
title: "Drone",
collapsable: true,
children: [
'drone/',
'drone/install'
]
},
],
'/': [
'/',
'/CHANGELOG',
'/CONTRIBUTING',
{
title: "Docker 简介",
collapsable: false,
children: [
'introduction/',
'introduction/what',
'introduction/why',
]
}, {
title: "基本概念",
collapsable: false,
children: [
'basic_concept/',
'basic_concept/image',
'basic_concept/container',
'basic_concept/repository'
]
},
{
title: "使用镜像",
collapsable: false,
children: [
'image/',
'image/pull',
'image/list',
'image/rm',
'image/commit',
'image/build',
'image/other.md',
'image/internal.md',
]
},
{
title: 'Dockerfile',
collapsable: true,
children: [
"image/dockerfile/",
'image/dockerfile/copy',
'image/dockerfile/add',
'image/dockerfile/cmd',
'image/dockerfile/entrypoint',
'image/dockerfile/env',
'image/dockerfile/arg',
'image/dockerfile/volume',
'image/dockerfile/expose',
'image/dockerfile/workdir',
'image/dockerfile/user',
'image/dockerfile/healthcheck',
'image/dockerfile/label',
'image/dockerfile/shell',
'image/dockerfile/onbuild',
'image/dockerfile/references',
'image/multistage-builds/',
'image/multistage-builds/laravel',
'image/manifest',
]
}, {
title: "操作容器",
collapsable: false,
children: [
'container/',
'container/run',
'container/daemon',
'container/stop',
'container/attach_exec',
'container/import_export',
'container/rm',
],
},
{
title: "Docker 仓库",
collapsable: false,
children: [
'repository/',
'repository/dockerhub',
'repository/registry',
'repository/registry_auth',
'repository/nexus3_registry',
],
},
{
title: "数据管理",
collapsable: false,
children: [
'data_management/',
'data_management/volume',
'data_management/bind-mounts',
],
}, {
title: "使用网络",
collapsable: false,
children: [
'network/',
'network/port_mapping',
'network/linking',
'network/dns',
],
},
{
title: "高级网络配置",
collapsable: true,
children: [
'advanced_network/',
'advanced_network/quick_guide',
'advanced_network/access_control',
'advanced_network/port_mapping',
'advanced_network/bridge',
'advanced_network/example',
'advanced_network/config_file',
'advanced_network/ptp',
],
},
{
title: "Swarm mode",
collapsable: true,
children: [
'swarm_mode/',
'swarm_mode/overview',
'swarm_mode/create',
'swarm_mode/deploy',
'swarm_mode/stack',
'swarm_mode/secret',
'swarm_mode/config',
'swarm_mode/rolling_update',
],
},
{
title: "安全",
collapsable: true,
children: [
'security/',
'security/kernel_ns',
'security/control_group',
'security/daemon_sec',
'security/kernel_capability',
'security/other_feature',
'security/summary',
],
},
{
title: "底层实现",
collapsable: true,
children: [
'underly/',
'underly/arch',
'underly/namespace',
'underly/cgroups',
'underly/ufs',
'underly/container_format',
'underly/network',
],
},
{
title: "Docker Buildx",
collapsable: false,
children: [
"buildx/",
"buildx/buildkit",
"buildx/buildx",
"buildx/multi-arch-images",
],
},
{
title: "Etcd",
collapsable: true,
children: [
'etcd/',
'etcd/intro',
'etcd/install',
'etcd/cluster',
'etcd/etcdctl',
],
},
{
title: "Fedora CoreOS",
collapsable: true,
children: [
'coreos/',
'coreos/intro',
'coreos/install',
],
},
'podman/',
'appendix/faq/',
{
title: "热门镜像介绍",
collapsable: true,
children: [
'appendix/repo/',
'appendix/repo/ubuntu',
'appendix/repo/centos',
'appendix/repo/nginx',
'appendix/repo/php',
'appendix/repo/nodejs',
'appendix/repo/mysql',
'appendix/repo/wordpress',
'appendix/repo/mongodb',
'appendix/repo/redis',
'appendix/repo/minio',
],
},
{
title: "Docker 命令",
collapsable: true,
children: [
'appendix/command/',
'appendix/command/docker',
'appendix/command/dockerd',
]
},
'appendix/best_practices',
'appendix/debug',
'appendix/resources',
],
},
}
});

View File

@ -0,0 +1,52 @@
import { defineHopeConfig } from "vuepress-theme-hope";
import navbar from "./navbar";
import sidebar from "./sidebar";
export default defineHopeConfig({
title: "Docker 从入门到实践",
head: [
[
"script",
{ src: "//hm.baidu.com/hm.js?81a3490c9cd141dbcf6d00bc18b6edae" }
],
["script", { src: "//zz.bdstatic.com/linksubmit/push.js" }]
],
locales: {
"/": {
lang: "zh-CN"
}
},
themeConfig: {
hostname: "https://vuepress.mirror.docker-practice.com",
pageInfo: ["ReadingTime", "Word"],
footer:
"Theme by <a target='_blank' href='https://github.com/vuepress-theme-hope/vuepress-theme-hope'>vuepress-theme-hope</a>",
displayFooter: true,
repo: "yeasy/docker_practice",
docsBranch: "master",
navbar,
sidebar,
contributors: false,
themeColor: false,
fullScreen: false,
plugins: {
blog: false,
search: {
locales: {
"/zh/": {
placeholder: "搜索"
}
}
}
}
}
});

View File

@ -0,0 +1,44 @@
import { defineNavbarConfig } from "vuepress-theme-hope";
export default defineNavbarConfig([
{
text: "微信交流群",
link: "https://docker_practice.gitee.io/pic/dpsig-wechat.jpg",
},
{
text: "小程序",
link: "https://docker_practice.gitee.io/pic/dp-wechat-miniprogram.jpg",
},
{
text: "安装 Docker",
link: "/install/",
},
{
text: "Docker 入门",
link: "/",
},
{
text: "Docker 实战",
link: "/cases/os/",
},
{
text: "CI/CD",
link: "/cases/ci/",
},
{
text: "Compose",
link: "/compose/",
},
{
text: "Kubernetes",
link: "/kubernetes/",
},
{
text: "云计算",
link: "/cloud/",
},
{
text: "云服务器99/元首年特惠",
link: "https://cloud.tencent.com/act/cps/redirect?redirect=1062&cps_key=3a5255852d5db99dcd5da4c72f05df61&from=console",
},
]);

View File

@ -0,0 +1,284 @@
import { defineSidebarConfig } from "vuepress-theme-hope";
export default defineSidebarConfig({
"/cloud/": ["intro", "tencentCloud", "alicloud", "aws", "summary"],
"/kubernetes/": [
"intro",
"concepts",
"design",
{
text: "部署 Kubernetes",
collapsable: true,
children: [
"setup/",
"setup/kubeadm",
"setup/docker-desktop",
"setup/systemd",
"setup/dashboard",
],
},
{
text: "Kubernetes 命令行 kubectl",
collapsable: true,
children: ["kubectl/"],
},
],
"/compose/": [
"introduction",
"v2",
"install",
"usage",
"commands",
"compose_file",
"django",
"rails",
"wordpress",
"lnmp",
],
"/install/": [
"ubuntu",
"debian",
"fedora",
"centos",
"raspberry-pi",
// 'offline',
"mac",
"windows",
"mirror",
"experimental",
],
"/cases/os/": [
{
text: "操作系统",
collapsable: false,
children: ["busybox", "alpine", "debian", "centos", "summary"],
},
{
text: "在 IDE 中使用 Docker",
collapsable: false,
children: ["/ide/", "/ide/vsCode"],
},
],
"/cases/ci/": [
"actions/",
{
text: "Drone",
collapsable: true,
children: ["drone/", "drone/install"],
},
],
"/": [
"/",
"/CHANGELOG",
"/CONTRIBUTING",
{
text: "Docker 简介",
collapsable: false,
children: ["introduction/", "introduction/what", "introduction/why"],
},
{
text: "基本概念",
collapsable: false,
children: [
"basic_concept/",
"basic_concept/image",
"basic_concept/container",
"basic_concept/repository",
],
},
{
text: "使用镜像",
collapsable: false,
children: [
"image/",
"image/pull",
"image/list",
"image/rm",
"image/commit",
"image/build",
"image/other.md",
"image/internal.md",
],
},
{
text: "Dockerfile",
collapsable: true,
children: [
"image/dockerfile/",
"image/dockerfile/copy",
"image/dockerfile/add",
"image/dockerfile/cmd",
"image/dockerfile/entrypoint",
"image/dockerfile/env",
"image/dockerfile/arg",
"image/dockerfile/volume",
"image/dockerfile/expose",
"image/dockerfile/workdir",
"image/dockerfile/user",
"image/dockerfile/healthcheck",
"image/dockerfile/label",
"image/dockerfile/shell",
"image/dockerfile/onbuild",
"image/dockerfile/references",
"image/multistage-builds/",
"image/multistage-builds/laravel",
"image/manifest",
],
},
{
text: "操作容器",
collapsable: false,
children: [
"container/",
"container/run",
"container/daemon",
"container/stop",
"container/attach_exec",
"container/import_export",
"container/rm",
],
},
{
text: "Docker 仓库",
collapsable: false,
children: [
"repository/",
"repository/dockerhub",
"repository/registry",
"repository/registry_auth",
"repository/nexus3_registry",
],
},
{
text: "数据管理",
collapsable: false,
children: [
"data_management/",
"data_management/volume",
"data_management/bind-mounts",
],
},
{
text: "使用网络",
collapsable: false,
children: [
"network/",
"network/port_mapping",
"network/linking",
"network/dns",
],
},
{
text: "高级网络配置",
collapsable: true,
children: [
"advanced_network/",
"advanced_network/quick_guide",
"advanced_network/access_control",
"advanced_network/port_mapping",
"advanced_network/bridge",
"advanced_network/example",
"advanced_network/config_file",
"advanced_network/ptp",
],
},
{
text: "Swarm mode",
collapsable: true,
children: [
"swarm_mode/",
"swarm_mode/overview",
"swarm_mode/create",
"swarm_mode/deploy",
"swarm_mode/stack",
"swarm_mode/secret",
"swarm_mode/config",
"swarm_mode/rolling_update",
],
},
{
text: "安全",
collapsable: true,
children: [
"security/",
"security/kernel_ns",
"security/control_group",
"security/daemon_sec",
"security/kernel_capability",
"security/other_feature",
"security/summary",
],
},
{
text: "底层实现",
collapsable: true,
children: [
"underly/",
"underly/arch",
"underly/namespace",
"underly/cgroups",
"underly/ufs",
"underly/container_format",
"underly/network",
],
},
{
text: "Docker Buildx",
collapsable: false,
children: [
"buildx/",
"buildx/buildkit",
"buildx/buildx",
"buildx/multi-arch-images",
],
},
{
text: "Etcd",
collapsable: true,
children: [
"etcd/",
"etcd/intro",
"etcd/install",
"etcd/cluster",
"etcd/etcdctl",
],
},
{
text: "Fedora CoreOS",
collapsable: true,
children: ["coreos/", "coreos/intro", "coreos/install"],
},
"podman/",
"appendix/faq/",
{
text: "热门镜像介绍",
collapsable: true,
children: [
"appendix/repo/",
"appendix/repo/ubuntu",
"appendix/repo/centos",
"appendix/repo/nginx",
"appendix/repo/php",
"appendix/repo/nodejs",
"appendix/repo/mysql",
"appendix/repo/wordpress",
"appendix/repo/mongodb",
"appendix/repo/redis",
"appendix/repo/minio",
],
},
{
text: "Docker 命令",
collapsable: true,
children: [
"appendix/command/",
"appendix/command/docker",
"appendix/command/dockerd",
],
},
"appendix/best_practices",
"appendix/debug",
"appendix/resources",
],
});

View File

@ -0,0 +1 @@
$themeColor: #2196f3;

View File

@ -4,19 +4,20 @@
"description": "docker_practice", "description": "docker_practice",
"main": "index.js", "main": "index.js",
"devDependencies": { "devDependencies": {
"chalk": "^4.1.1", "chalk": "^4.1.2",
"commander": "^7.2.0", "commander": "^7.2.0",
"esm": "^3.0.0", "esm": "^3.0.0",
"vuepress": "1.8.2", "@vuepress/plugin-search": "2.0.0-beta.36",
"vuepress-plugin-container": "^2.1.5", "vuepress": "2.0.0-beta.36",
"vuepress-theme-hope": "^1.0.0" "vuepress-theme-hope": "2.0.0-beta.14"
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"gitbook:help": "gitbook help", "gitbook:help": "gitbook help",
"gitbook:build": "gitbook build", "gitbook:build": "gitbook build",
"gitbook:serve": "gitbook serve", "gitbook:serve": "gitbook serve",
"vuepress:build": "npx vuepress build", "vuepress:build": "vuepress build .",
"vuepress:serve": "vuepress dev .",
"vuepress": "npx vuepress" "vuepress": "npx vuepress"
}, },
"repository": { "repository": {