当前位置:   article > 正文

部署kubernetes官网博客

kubernetes官网

部署kubernetes官网博客

访问 https://kubernetes.io/ 有些时候不问题,部署离线内网使用官网以及博客, 各位尝鲜可以访问 https://doc.oiox.cn/

9e00f57197ba29c0c4700950638aa042.png

安装docker

  1. root@cby:~# curl -sSL https://get.daocloud.io/docker | sh
  2. # Executing docker install script, commit: 0221adedb4bcde0f3d18bddda023544fc56c29d1
  3. + sh -c apt-get update -qq >/dev/null
  4. + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
  5. + sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg
  6. + sh -c chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg
  7. + sh -c echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" > /etc/apt/sources.list.d/docker.list
  8. + sh -c apt-get update -qq >/dev/null
  9. + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce docker-ce-cli docker-compose-plugin docker-scan-plugin >/dev/null
  10. + version_gte 20.10
  11. + [ -z  ]
  12. return 0
  13. + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null
  14. + sh -c docker version
  15. Client: Docker Engine - Community
  16.  Version:           20.10.15
  17.  API version:       1.41
  18.  Go version:        go1.17.9
  19.  Git commit:        fd82621
  20.  Built:             Thu May  5 13:19:23 2022
  21.  OS/Arch:           linux/amd64
  22.  Context:           default
  23.  Experimental:      true
  24. Server: Docker Engine - Community
  25.  Engine:
  26.   Version:          20.10.15
  27.   API version:      1.41 (minimum version 1.12)
  28.   Go version:       go1.17.9
  29.   Git commit:       4433bf6
  30.   Built:            Thu May  5 13:17:28 2022
  31.   OS/Arch:          linux/amd64
  32.   Experimental:     false
  33.  containerd:
  34.   Version:          1.6.4
  35.   GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
  36.  runc:
  37.   Version:          1.1.1
  38.   GitCommit:        v1.1.1-0-g52de29d
  39.  docker-init:
  40.   Version:          0.19.0
  41.   GitCommit:        de40ad0
  42. ================================================================================
  43. To run Docker as a non-privileged user, consider setting up the
  44. Docker daemon in rootless mode for your user:
  45.     dockerd-rootless-setuptool.sh install
  46. Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.
  47. To run the Docker daemon as a fully privileged service, but granting non-root
  48. users access, refer to https://docs.docker.com/go/daemon-access/
  49. WARNING: Access to the remote API on a privileged Docker daemon is equivalent
  50.          to root access on the host. Refer to the 'Docker daemon attack surface'
  51.          documentation for details: https://docs.docker.com/go/attack-surface/
  52. ================================================================================
  53. root@cby:~#

克隆库

  1. root@cby:~# git clone https://github.com/kubernetes/website.git
  2. Cloning into 'website'...
  3. remote: Enumerating objects: 269472, done.
  4. remote: Counting objects: 100% (354/354), done.
  5. remote: Compressing objects: 100% (240/240), done.
  6. remote: Total 269472 (delta 201), reused 221 (delta 112), pack-reused 269118
  7. Receiving objects: 100% (269472/269472), 334.98 MiB | 1.92 MiB/s, done.
  8. Resolving deltas: 100% (190520/190520), done.
  9. Updating files: 100% (7124/7124), done.
  10. root@cby:~# cd website
  11. root@cby:~/website#

安装依赖

  1. root@cby:~/website# git submodule update --init --recursive --depth 1
  2. Submodule 'api-ref-generator' (https://github.com/kubernetes-sigs/reference-docs) registered for path 'api-ref-generator'
  3. Submodule 'themes/docsy' (https://github.com/google/docsy.git) registered for path 'themes/docsy'
  4. Cloning into '/root/website/api-ref-generator'...
  5. Cloning into '/root/website/themes/docsy'...
  6. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  7. remote: Enumerating objects: 104, done.
  8. remote: Counting objects: 100% (104/104), done.
  9. remote: Compressing objects: 100% (53/53), done.
  10. remote: Total 61 (delta 34), reused 23 (delta 6), pack-reused 0
  11. Unpacking objects: 100% (61/61), 103.64 KiB | 252.00 KiB/s, done.
  12. From https://github.com/kubernetes-sigs/reference-docs
  13.  * branch            55bce686224caba37f93e1e1eb53c0c9fc104ed4 -> FETCH_HEAD
  14. Submodule path 'api-ref-generator': checked out '55bce686224caba37f93e1e1eb53c0c9fc104ed4'
  15. Submodule 'themes/docsy' (https://github.com/google/docsy.git) registered for path 'api-ref-generator/themes/docsy'
  16. Cloning into '/root/website/api-ref-generator/themes/docsy'...
  17. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  18. remote: Enumerating objects: 251, done.
  19. remote: Counting objects: 100% (251/251), done.
  20. remote: Compressing objects: 100% (119/119), done.
  21. remote: Total 130 (delta 82), reused 34 (delta 3), pack-reused 0
  22. Receiving objects: 100% (130/130), 43.96 KiB | 308.00 KiB/s, done.
  23. Resolving deltas: 100% (82/82), completed with 77 local objects.
  24. From https://github.com/google/docsy
  25.  * branch            6b30513dc837c5937de351f2fb2e4fedb04365c4 -> FETCH_HEAD
  26. Submodule path 'api-ref-generator/themes/docsy': checked out '6b30513dc837c5937de351f2fb2e4fedb04365c4'
  27. Submodule 'assets/vendor/Font-Awesome' (https://github.com/FortAwesome/Font-Awesome.git) registered for path 'api-ref-generator/themes/docsy/assets/vendor/Font-Awesome'
  28. Submodule 'assets/vendor/bootstrap' (https://github.com/twbs/bootstrap.git) registered for path 'api-ref-generator/themes/docsy/assets/vendor/bootstrap'
  29. Cloning into '/root/website/api-ref-generator/themes/docsy/assets/vendor/Font-Awesome'...
  30. Cloning into '/root/website/api-ref-generator/themes/docsy/assets/vendor/bootstrap'...
  31. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  32. remote: Enumerating objects: 8924, done.
  33. remote: Counting objects: 100% (8921/8921), done.
  34. remote: Compressing objects: 100% (2868/2868), done.
  35. remote: Total 4847 (delta 3027), reused 2286 (delta 1978), pack-reused 0
  36. Receiving objects: 100% (4847/4847), 5.77 MiB | 4.38 MiB/s, done.
  37. Resolving deltas: 100% (3027/3027), completed with 884 local objects.
  38. From https://github.com/FortAwesome/Font-Awesome
  39.  * branch            fcec2d1b01ff069ac10500ac42e4478d20d21f4c -> FETCH_HEAD
  40. Submodule path 'api-ref-generator/themes/docsy/assets/vendor/Font-Awesome': checked out 'fcec2d1b01ff069ac10500ac42e4478d20d21f4c'
  41. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  42. remote: Enumerating objects: 701, done.
  43. remote: Counting objects: 100% (701/701), done.
  44. remote: Compressing objects: 100% (511/511), done.
  45. remote: Total 528 (delta 115), reused 186 (delta 13), pack-reused 0
  46. Receiving objects: 100% (528/528), 2.01 MiB | 5.52 MiB/s, done.
  47. Resolving deltas: 100% (115/115), completed with 73 local objects.
  48. From https://github.com/twbs/bootstrap
  49.  * branch            a716fb03f965dc0846df479e14388b1b4b93d7ce -> FETCH_HEAD
  50. Submodule path 'api-ref-generator/themes/docsy/assets/vendor/bootstrap': checked out 'a716fb03f965dc0846df479e14388b1b4b93d7ce'
  51. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  52. remote: Enumerating objects: 76, done.
  53. remote: Counting objects: 100% (76/76), done.
  54. remote: Compressing objects: 100% (37/37), done.
  55. remote: Total 39 (delta 30), reused 6 (delta 0), pack-reused 0
  56. Unpacking objects: 100% (39/39), 4.48 KiB | 654.00 KiB/s, done.
  57. From https://github.com/google/docsy
  58.  * branch            1c77bb24483946f11c13f882f836a940b55ad019 -> FETCH_HEAD
  59. Submodule path 'themes/docsy': checked out '1c77bb24483946f11c13f882f836a940b55ad019'
  60. Submodule 'assets/vendor/Font-Awesome' (https://github.com/FortAwesome/Font-Awesome.git) registered for path 'themes/docsy/assets/vendor/Font-Awesome'
  61. Submodule 'assets/vendor/bootstrap' (https://github.com/twbs/bootstrap.git) registered for path 'themes/docsy/assets/vendor/bootstrap'
  62. Cloning into '/root/website/themes/docsy/assets/vendor/Font-Awesome'...
  63. Cloning into '/root/website/themes/docsy/assets/vendor/bootstrap'...
  64. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  65. remote: Enumerating objects: 8925, done.
  66. remote: Counting objects: 100% (8922/8922), done.
  67. remote: Compressing objects: 100% (2801/2801), done.
  68. remote: Total 4848 (delta 3031), reused 2433 (delta 2046), pack-reused 0
  69. Receiving objects: 100% (4848/4848), 5.65 MiB | 4.21 MiB/s, done.
  70. Resolving deltas: 100% (3031/3031), completed with 855 local objects.
  71. From https://github.com/FortAwesome/Font-Awesome
  72.  * branch            7d3d774145ac38663f6d1effc6def0334b68ab7e -> FETCH_HEAD
  73. Submodule path 'themes/docsy/assets/vendor/Font-Awesome': checked out '7d3d774145ac38663f6d1effc6def0334b68ab7e'
  74. remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  75. remote: Enumerating objects: 770, done.
  76. remote: Counting objects: 100% (770/770), done.
  77. remote: Compressing objects: 100% (497/497), done.
  78. remote: Total 524 (delta 161), reused 183 (delta 19), pack-reused 0
  79. Receiving objects: 100% (524/524), 2.01 MiB | 2.53 MiB/s, done.
  80. Resolving deltas: 100% (161/161), completed with 122 local objects.
  81. From https://github.com/twbs/bootstrap
  82.  * branch            043a03c95a2ad6738f85b65e53b9dbdfb03b8d10 -> FETCH_HEAD
  83. Submodule path 'themes/docsy/assets/vendor/bootstrap': checked out '043a03c95a2ad6738f85b65e53b9dbdfb03b8d10'
  84. root@cby:~/website#

构建镜像

  1. root@cby:~/website# make container-image
  2. docker build . \
  3.     --network=host \
  4.     --tag gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c \
  5.     --build-arg HUGO_VERSION=0.87.0
  6. Sending build context to Docker daemon  4.096kB
  7. Step 1/12 : FROM golang:1.16-alpine
  8. 1.16-alpine: Pulling from library/golang
  9. 59bf1c3509f3: Pull complete 
  10. 666ba61612fd: Pull complete 
  11. 8ed8ca486205: Pull complete 
  12. ca4bf87e467a: Pull complete 
  13. 0435e0963794: Pull complete 
  14. Digest: sha256:5616dca835fa90ef13a843824ba58394dad356b7d56198fb7c93cbe76d7d67fe
  15. Status: Downloaded newer image for golang:1.16-alpine
  16.  ---> 7642119cd161
  17. Step 2/12 : LABEL maintainer="Luc Perkins <lperkins@linuxfoundation.org>"
  18.  ---> Running in f6a8d1fa0c42
  19. Removing intermediate container f6a8d1fa0c42
  20.  ---> 291fd45ae748
  21. Step 3/12 : RUN apk add --no-cache     curl     gcc     g++     musl-dev     build-base     libc6-compat
  22.  ---> Running in 209e30a852d3
  23. fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
  24. fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
  25. (1/25) Installing libgcc (10.3.1_git20211027-r0)
  26. (2/25) Installing libstdc++ (10.3.1_git20211027-r0)
  27. (3/25) Installing binutils (2.37-r3)
  28. (4/25) Installing libmagic (5.41-r0)
  29. (5/25) Installing file (5.41-r0)
  30. (6/25) Installing libgomp (10.3.1_git20211027-r0)
  31. (7/25) Installing libatomic (10.3.1_git20211027-r0)
  32. (8/25) Installing libgphobos (10.3.1_git20211027-r0)
  33. (9/25) Installing gmp (6.2.1-r1)
  34. (10/25) Installing isl22 (0.22-r0)
  35. (11/25) Installing mpfr4 (4.1.0-r0)
  36. (12/25) Installing mpc1 (1.2.1-r0)
  37. (13/25) Installing gcc (10.3.1_git20211027-r0)
  38. (14/25) Installing musl-dev (1.2.2-r7)
  39. (15/25) Installing libc-dev (0.7.2-r3)
  40. (16/25) Installing g++ (10.3.1_git20211027-r0)
  41. (17/25) Installing make (4.3-r0)
  42. (18/25) Installing fortify-headers (1.1-r1)
  43. (19/25) Installing patch (2.7.6-r7)
  44. (20/25) Installing build-base (0.5-r2)
  45. (21/25) Installing brotli-libs (1.0.9-r5)
  46. (22/25) Installing nghttp2-libs (1.46.0-r0)
  47. (23/25) Installing libcurl (7.80.0-r1)
  48. (24/25) Installing curl (7.80.0-r1)
  49. (25/25) Installing libc6-compat (1.2.2-r7)
  50. Executing busybox-1.34.1-r3.trigger
  51. OK: 198 MiB in 40 packages
  52. Removing intermediate container 209e30a852d3
  53.  ---> 83dfeba4ff34
  54. Step 4/12 : ARG HUGO_VERSION
  55.  ---> Running in fdbe162165c2
  56. Removing intermediate container fdbe162165c2
  57.  ---> d6219e970f50
  58. Step 5/12 : RUN mkdir $HOME/src &&     cd $HOME/src &&     curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz &&     cd "hugo-${HUGO_VERSION}" &&     go install --tags extended
  59.  ---> Running in fe0b26ed3841
  60.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  61.                                  Dload  Upload   Total   Spent    Left  Speed
  62.   0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  63. 100 35.2M    0 35.2M    0     0  2216k      0 --:--:--  0:00:16 --:--:-- 3037k
  64. go: downloading github.com/alecthomas/chroma v0.9.2
  65. go: downloading github.com/bep/debounce v1.2.0
  66. go: downloading github.com/fsnotify/fsnotify v1.4.9
  67. go: downloading github.com/pkg/errors v0.9.1
  68. go: downloading github.com/spf13/afero v1.6.0
  69. go: downloading github.com/spf13/cobra v1.2.1
  70. go: downloading github.com/spf13/fsync v0.9.0
  71. go: downloading github.com/spf13/jwalterweatherman v1.1.0
  72. go: downloading github.com/spf13/pflag v1.0.5
  73. go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
  74. go: downloading github.com/pelletier/go-toml v1.9.3
  75. go: downloading github.com/spf13/cast v1.4.0
  76. go: downloading github.com/PuerkitoBio/purell v1.1.1
  77. go: downloading github.com/gobwas/glob v0.2.3
  78. go: downloading github.com/mattn/go-isatty v0.0.13
  79. go: downloading github.com/mitchellh/mapstructure v1.4.1
  80. go: downloading github.com/aws/aws-sdk-go v1.40.8
  81. go: downloading github.com/dustin/go-humanize v1.0.0
  82. go: downloading gocloud.dev v0.20.0
  83. go: downloading github.com/pelletier/go-toml/v2 v2.0.0-beta.3.0.20210727221244-fa0796069526
  84. go: downloading golang.org/x/text v0.3.6
  85. go: downloading google.golang.org/api v0.51.0
  86. go: downloading github.com/jdkato/prose v1.2.1
  87. go: downloading github.com/kyokomi/emoji/v2 v2.2.8
  88. go: downloading github.com/mitchellh/hashstructure v1.1.0
  89. go: downloading github.com/olekukonko/tablewriter v0.0.5
  90. go: downloading github.com/armon/go-radix v1.0.0
  91. go: downloading github.com/gohugoio/locales v0.14.0
  92. go: downloading github.com/gohugoio/localescompressed v0.14.0
  93. go: downloading github.com/gorilla/websocket v1.4.2
  94. go: downloading github.com/rogpeppe/go-internal v1.8.0
  95. go: downloading gopkg.in/yaml.v2 v2.4.0
  96. go: downloading github.com/niklasfasching/go-org v1.5.0
  97. go: downloading github.com/bep/gitmap v1.1.2
  98. go: downloading github.com/gobuffalo/flect v0.2.3
  99. go: downloading golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
  100. go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
  101. go: downloading github.com/cli/safeexec v1.0.0
  102. go: downloading github.com/dlclark/regexp2 v1.4.0
  103. go: downloading github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69
  104. go: downloading github.com/disintegration/gift v1.2.1
  105. go: downloading golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb
  106. go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
  107. go: downloading golang.org/x/net v0.0.0-20210614182718-04defd469f4e
  108. go: downloading go.opencensus.io v0.23.0
  109. go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
  110. go: downloading github.com/Azure/azure-pipeline-go v0.2.2
  111. go: downloading github.com/Azure/azure-storage-blob-go v0.9.0
  112. go: downloading github.com/google/uuid v1.1.2
  113. go: downloading github.com/google/wire v0.4.0
  114. go: downloading cloud.google.com/go v0.87.0
  115. go: downloading github.com/googleapis/gax-go v2.0.2+incompatible
  116. go: downloading github.com/googleapis/gax-go/v2 v2.0.5
  117. go: downloading cloud.google.com/go/storage v1.10.0
  118. go: downloading golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
  119. go: downloading google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea
  120. go: downloading github.com/mattn/go-runewidth v0.0.9
  121. go: downloading github.com/bep/tmc v0.5.1
  122. go: downloading github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd
  123. go: downloading github.com/gohugoio/go-i18n/v2 v2.1.3-0.20210430103248-4c28c89f8013
  124. go: downloading github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6
  125. go: downloading github.com/bep/gowebp v0.1.0
  126. go: downloading github.com/muesli/smartcrop v0.3.0
  127. go: downloading google.golang.org/grpc v1.39.0
  128. go: downloading github.com/mattn/go-ieproxy v0.0.1
  129. go: downloading github.com/russross/blackfriday/v2 v2.0.1
  130. go: downloading google.golang.org/protobuf v1.27.1
  131. go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
  132. go: downloading github.com/yuin/goldmark v1.4.0
  133. go: downloading github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691
  134. go: downloading github.com/miekg/mmark v1.3.6
  135. go: downloading github.com/tdewolff/minify/v2 v2.9.21
  136. go: downloading github.com/sanity-io/litter v1.5.1
  137. go: downloading github.com/getkin/kin-openapi v0.68.0
  138. go: downloading github.com/ghodss/yaml v1.0.0
  139. go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
  140. go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
  141. go: downloading github.com/jmespath/go-jmespath v0.4.0
  142. go: downloading github.com/BurntSushi/toml v0.3.1
  143. go: downloading github.com/evanw/esbuild v0.12.17
  144. go: downloading github.com/tdewolff/parse/v2 v2.5.19
  145. go: downloading github.com/bep/godartsass v0.12.0
  146. go: downloading github.com/bep/golibsass v1.0.0
  147. go: downloading github.com/golang/protobuf v1.5.2
  148. go: downloading github.com/google/go-cmp v0.5.6
  149. go: downloading github.com/go-openapi/jsonpointer v0.19.5
  150. go: downloading github.com/go-openapi/swag v0.19.5
  151. go: downloading github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
  152. Removing intermediate container fe0b26ed3841
  153.  ---> 034cde1adc00
  154. Step 6/12 : FROM golang:1.16-alpine
  155.  ---> 7642119cd161
  156. Step 7/12 : RUN apk add --no-cache     runuser     git     openssh-client     rsync     npm &&     npm install -D autoprefixer postcss-cli
  157.  ---> Running in 2af5902e5287
  158. fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
  159. fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
  160. (1/27) Installing brotli-libs (1.0.9-r5)
  161. (2/27) Installing nghttp2-libs (1.46.0-r0)
  162. (3/27) Installing libcurl (7.80.0-r1)
  163. (4/27) Installing expat (2.4.7-r0)
  164. (5/27) Installing pcre2 (10.39-r0)
  165. (6/27) Installing git (2.34.2-r0)
  166. (7/27) Installing c-ares (1.18.1-r0)
  167. (8/27) Installing libgcc (10.3.1_git20211027-r0)
  168. (9/27) Installing libstdc++ (10.3.1_git20211027-r0)
  169. (10/27) Installing icu-libs (69.1-r1)
  170. (11/27) Installing libuv (1.42.0-r0)
  171. (12/27) Installing nodejs-current (17.9.0-r0)
  172. (13/27) Installing npm (8.1.3-r0)
  173. (14/27) Installing openssh-keygen (8.8_p1-r1)
  174. (15/27) Installing ncurses-terminfo-base (6.3_p20211120-r0)
  175. (16/27) Installing ncurses-libs (6.3_p20211120-r0)
  176. (17/27) Installing libedit (20210910.3.1-r0)
  177. (18/27) Installing openssh-client-common (8.8_p1-r1)
  178. (19/27) Installing openssh-client-default (8.8_p1-r1)
  179. (20/27) Installing libacl (2.2.53-r0)
  180. (21/27) Installing lz4-libs (1.9.3-r1)
  181. (22/27) Installing popt (1.18-r0)
  182. (23/27) Installing zstd-libs (1.5.0-r0)
  183. (24/27) Installing rsync (3.2.3-r5)
  184. (25/27) Installing libeconf (0.4.2-r0)
  185. (26/27) Installing linux-pam (1.5.2-r0)
  186. (27/27) Installing runuser (2.37.4-r0)
  187. Executing busybox-1.34.1-r3.trigger
  188. OK: 106 MiB in 42 packages
  189. added 73 packages, and audited 74 packages in 15s
  190. 17 packages are looking for funding
  191.   run `npm fund` for details
  192. found 0 vulnerabilities
  193. Removing intermediate container 2af5902e5287
  194.  ---> 620ef2580a98
  195. Step 8/12 : RUN mkdir -p /var/hugo &&     addgroup -Sg 1000 hugo &&     adduser -Sg hugo -u 1000 -h /var/hugo hugo &&     chown -R hugo: /var/hugo &&     runuser -u hugo -- git config --global --add safe.directory /src
  196.  ---> Running in dc169979de70
  197. Removing intermediate container dc169979de70
  198.  ---> 1006a4277115
  199. Step 9/12 : COPY --from=0 /go/bin/hugo /usr/local/bin/hugo
  200.  ---> 9bd8581cf0c3
  201. Step 10/12 : WORKDIR /src
  202.  ---> Running in 89fb367fe208
  203. Removing intermediate container 89fb367fe208
  204.  ---> b299d26f87a7
  205. Step 11/12 : USER hugo:hugo
  206.  ---> Running in 353a5aec3b6e
  207. Removing intermediate container 353a5aec3b6e
  208.  ---> ec88a8ce29a5
  209. Step 12/12 : EXPOSE 1313
  210.  ---> Running in 2649b06d597f
  211. Removing intermediate container 2649b06d597f
  212.  ---> 20b483234fde
  213. Successfully built 20b483234fde
  214. Successfully tagged gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c
  215. root@cby:~/website#

构建容器

  1. root@cby:~/website# make container-serve
  2. docker run --rm --interactive --tty --volume /root/website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
  3. Start building sites … 
  4. hugo v0.87.0+extended linux/amd64 BuildDate=unknown
  5. ----
  6.                    |  EN  |  ZH  | KO  | JA  | FR  | IT  | DE  | ES  | PT-BR | ID  | RU  | VI  | PL  | UK   
  7. -------------------+------+------+-----+-----+-----+-----+-----+-----+-------+-----+-----+-----+-----+------
  8.   Pages            | 1453 | 1015 | 539 | 450 | 338 |  71 | 164 | 292 |   186 | 335 | 155 |  77 |  69 |  92  
  9.   Paginator pages  |   43 |    9 |   0 |   0 |   0 |   0 |   0 |   0 |     0 |   0 |   0 |   0 |   0 |   0  
  10.   Non-page files   |  509 |  386 | 200 | 266 |  73 |  20 |  17 |  33 |    30 | 105 |  24 |   8 |   6 |  20  
  11.   Static files     |  838 |  838 | 838 | 838 | 838 | 838 | 838 | 838 |   838 | 838 | 838 | 838 | 838 | 838  
  12.   Processed images |    1 |    1 |   0 |   0 |   0 |   0 |   0 |   0 |     0 |   0 |   0 |   0 |   0 |   0  
  13.   Aliases          |    8 |    2 |   3 |   1 |   0 |   1 |   0 |   0 |     1 |   1 |   1 |   0 |   0 |   0  
  14.   Sitemaps         |    2 |    1 |   1 |   1 |   1 |   1 |   1 |   1 |     1 |   1 |   1 |   1 |   1 |   1  
  15.   Cleaned          |    0 |    0 |   0 |   0 |   0 |   0 |   0 |   0 |     0 |   0 |   0 |   0 |   0 |   0  
  16. Built in 15926 ms
  17. Watching for changes in /src/{archetypes,assets,content,data,i18n,layouts,package.json,postcss.config.js,static,themes}
  18. Watching for config changes in /src/config.toml, /src/themes/docsy/config.toml, /src/go.mod
  19. Environment: "development"
  20. Serving pages from /tmp/hugo
  21. Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
  22. Web Server is available at http://localhost:1313/ (bind address 0.0.0.0)
  23. Press Ctrl+C to stop

后台启动

  1. root@cby:~# docker images
  2. REPOSITORY                                     TAG                    IMAGE ID       CREATED         SIZE
  3. gcr.io/k8s-staging-sig-docs/k8s-website-hugo   v0.87.0-c8ffb2b5979c   20b483234fde   4 minutes ago   501MB
  4. <none>                                         <none>                 034cde1adc00   4 minutes ago   1.8GB
  5. golang                                         1.16-alpine            7642119cd161   2 months ago    302MB
  6. root@cby:~#
  7. root@cby:~/website# docker run --rm --interactive -d --volume /root/website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
  8. docker run --rm --interactive -d --volume /root/website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
  9. root@cby:~/website# docker ps
  10. CONTAINER ID   IMAGE                                                               COMMAND                  CREATED         STATUS         PORTS                                       NAMES
  11. 06f34ad73c67   gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c   "hugo server --build…"   5 seconds ago   Up 4 seconds   0.0.0.0:1313->1313/tcp, :::1313->1313/tcp   nervous_kilby
  12. root@cby:~/website#

更新文档

  1. root@hello:~/website# git pull
  2. remote: Enumerating objects: 187, done.
  3. remote: Counting objects: 100% (181/181), done.
  4. remote: Compressing objects: 100% (112/112), done.
  5. remote: Total 187 (delta 107), reused 126 (delta 69), pack-reused 6
  6. Receiving objects: 100% (187/187), 154.37 KiB | 403.00 KiB/s, done.
  7. Resolving deltas: 100% (107/107), completed with 35 local objects.
  8. From https://github.com/kubernetes/website
  9.    f559e15074..07e1929b49  main          -> origin/main
  10.    8c980f042b..68e621e794  dev-1.24-ko.1 -> origin/dev-1.24-ko.1
  11. Updating f559e15074..07e1929b49
  12. Fast-forward
  13.  content/en/docs/concepts/cluster-administration/manage-deployment.md                             |   2 +-
  14.  content/en/docs/concepts/containers/runtime-class.md                                             |   2 +-
  15.  content/en/docs/concepts/workloads/pods/init-containers.md                                       |   1 -
  16.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_generate-csr.md            |   3 ---
  17.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md          |   3 ---
  18.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-certs.md       |   3 ---
  19.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join.md |   3 ---
  20.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_token.md                         |   3 ---
  21.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_create.md                  |   1 -
  22.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_delete.md                  |   3 ---
  23.  content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_version.md                       |   3 ---
  24.  content/en/docs/setup/production-environment/windows/intro-windows-in-kubernetes.md              |   2 +-
  25.  content/en/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md                         |   2 +-
  26.  content/en/docs/tasks/configure-pod-container/configure-pod-initialization.md                    |   1 -
  27.  content/en/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md              |   2 +-
  28.  content/pt-br/blog/_posts/2022-02-17-updated-dockershim-faq.md                                   |   2 +-
  29.  content/zh/docs/concepts/architecture/nodes.md                                                   | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
  30.  content/zh/docs/concepts/cluster-administration/system-logs.md                                   | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------
  31.  content/zh/docs/concepts/containers/runtime-class.md                                             |  62 +++++++++++++++++++++-----------------------------------------
  32.  content/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md                | 111 +++++++++++++++++++++------------------------------------------------------------------------------------------
  33.  content/zh/docs/concepts/overview/kubernetes-api.md                                              |  71 +++++++++++++++++++++++++++++++++++++++++++++++++----------------------
  34.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_generate-csr.md            |  26 ++++++++++++++++++++------
  35.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md          |  28 +++++++++++++++++++++++++---
  36.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-certs.md       |  30 +++++++++++++++++++++++++++++-
  37.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join.md |  20 +++++++++++++++++++-
  38.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token.md                         |  24 +++++++++++++++++++++++-
  39.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_create.md                  |  51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
  40.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_delete.md                  |  24 +++++++++++++++++++++++-
  41.  content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_version.md                       |  24 +++++++++++++++++++++++-
  42.  static/_redirects                                                                                |  48 +++++++++++++++++++++++++++++++++---------------
  43.  30 files changed, 539 insertions(+), 267 deletions(-)
  44. root@hello:~/website#

f2791f152f0ad90aa47cde2abddee2ac.png

https://www.oiox.cn/

https://www.chenby.cn/

https://blog.oiox.cn/

https://cby-chen.github.io/

https://blog.csdn.net/qq_33921750

https://my.oschina.net/u/3981543

https://www.zhihu.com/people/chen-bu-yun-2

https://segmentfault.com/u/hppyvyv6/articles

https://juejin.cn/user/3315782802482007

https://cloud.tencent.com/developer/column/93230

https://www.jianshu.com/u/0f894314ae2c

https://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/

CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》

文章主要发布于微信公众号:《Linux运维交流社区》

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/242949
推荐阅读
  

闽ICP备14008679号