Skip to content

Instantly share code, notes, and snippets.

@gochist
Created August 20, 2018 12:07
Show Gist options
  • Save gochist/53b6d5f11d459f2371e701a81af8f88c to your computer and use it in GitHub Desktop.
Save gochist/53b6d5f11d459f2371e701a81af8f88c to your computer and use it in GitHub Desktop.
Build Docs

build and serve k8s docs using docker

kubernetes-docs-ko$ HUGO_VERSION=0.46 make docker-image -e
kubernetes-docs-ko$ make docker-serve

Logs

~/git/kubernetes-docs-ko$ HUGO_VERSION=0.46 make docker-image -e
docker build . --tag kubernetes-hugo --build-arg HUGO_VERSION=0.46
Sending build context to Docker daemon  219.1MB
Step 1/7 : FROM alpine:latest
latest: Pulling from library/alpine
8e3ba11ec2a2: Pull complete 
Digest: sha256:7043076348bf5040220df6ad703798fd8593a0918d06d3ce30c6c93be117e430
Status: Downloaded newer image for alpine:latest
 ---> 11cd0b38bc3c
Step 2/7 : MAINTAINER Luc Perkins <[email protected]>
 ---> Running in a0715b3d3c64
Removing intermediate container a0715b3d3c64
 ---> 8b4d81da9be4
Step 3/7 : RUN apk add --no-cache     curl     git     openssh-client     rsync
 ---> Running in 54005104a473
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/14) Installing ca-certificates (20171114-r3)
(2/14) Installing nghttp2-libs (1.32.0-r0)
(3/14) Installing libssh2 (1.8.0-r3)
(4/14) Installing libcurl (7.61.0-r0)
(5/14) Installing curl (7.61.0-r0)
(6/14) Installing expat (2.2.5-r0)
(7/14) Installing pcre2 (10.31-r0)
(8/14) Installing git (2.18.0-r0)
(9/14) Installing openssh-keygen (7.7_p1-r2)
(10/14) Installing openssh-client (7.7_p1-r2)
(11/14) Installing libattr (2.4.47-r7)
(12/14) Installing libacl (2.2.52-r5)
(13/14) Installing popt (1.16-r7)
(14/14) Installing rsync (3.1.3-r1)
Executing busybox-1.28.4-r0.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 23 MiB in 27 packages
Removing intermediate container 54005104a473
 ---> 7cb610f61e85
Step 4/7 : ARG HUGO_VERSION
 ---> Running in 4adb65e9a59f
Removing intermediate container 4adb65e9a59f
 ---> d93f0874dfe0
Step 5/7 : RUN mkdir -p /usr/local/src &&     cd /usr/local/src &&     curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-64bit.tar.gz | tar -xz &&     mv hugo /usr/local/bin/hugo &&     curl -L https://bin.equinox.io/c/dhgbqpS8Bvy/minify-stable-linux-amd64.tgz | tar -xz &&     mv minify /usr/local/bin &&     addgroup -Sg 1000 hugo &&     adduser -Sg hugo -u 1000 -h /src hugo
 ---> Running in 0f69c3792eb3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   618    0   618    0     0    599      0 --:--:--  0:00:01 --:--:--   599
100 6294k  100 6294k    0     0  1047k      0  0:00:06  0:00:06 --:--:-- 1418k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2399k  100 2399k    0     0   779k      0  0:00:03  0:00:03 --:--:--  779k
Removing intermediate container 0f69c3792eb3
 ---> 2f8296bf6763
Step 6/7 : WORKDIR /src
 ---> Running in 3d84414fe9c8
Removing intermediate container 3d84414fe9c8
 ---> d2ea53341582
Step 7/7 : EXPOSE 1313
 ---> Running in a985e34d1986
Removing intermediate container a985e34d1986
 ---> 924a9118f838
Successfully built 924a9118f838
Successfully tagged kubernetes-hugo:latest
june@june-hp-mini2:~/git/kubernetes-docs-ko$ make docker-serve
docker run --rm --interactive --tty --volume /home/june/git/kubernetes-docs-ko:/src -p 1313:1313 kubernetes-hugo hugo server --watch --bind 0.0.0.0

                   |  EN  | CN  | KO   
+------------------+------+-----+-----+
  Pages            | 1590 | 184 |  61  
  Paginator pages  |  230 |   0 |   0  
  Non-page files   |  407 | 269 | 264  
  Static files     |  793 | 793 | 793  
  Processed images |    0 |   0 |   0  
  Aliases          |    3 |   1 |   1  
  Sitemaps         |    2 |   1 |   1  
  Cleaned          |    0 |   0 |   0  

Total in 11411 ms
Watching for changes in /src/{assets,content,data,layouts,static}
Watching for config changes in /src/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 0.0.0.0)
Press Ctrl+C to stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment