Skip to content

Commit 11f3079

Browse files
authored
Merge pull request #22995 from inductor/feature/improve_build
Improve front build
2 parents 9415afa + 59d643b commit 11f3079

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN apk add --no-cache \
1616
build-base \
1717
libc6-compat \
1818
npm && \
19-
npm install -G autoprefixer postcss-cli
19+
npm install -D autoprefixer postcss-cli
2020

2121
ARG HUGO_VERSION
2222

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ container-image:
6565
--build-arg HUGO_VERSION=$(HUGO_VERSION)
6666

6767
container-build: module-check
68-
$(CONTAINER_RUN) --read-only $(CONTAINER_IMAGE) hugo --minify
68+
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify"
6969

7070
container-serve: module-check
7171
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ You can run the website locally using Hugo (Extended version), or you can run it
1212

1313
To use this repository, you need the following installed locally:
1414

15-
- [yarn](https://yarnpkg.com/)
1615
- [npm](https://www.npmjs.com/)
1716
- [Go](https://golang.org/)
1817
- [Hugo (Extended version)](https://gohugo.io/)
@@ -28,9 +27,6 @@ cd website
2827
The Kubernetes website uses the [Docsy Hugo theme](https://github.com/google/docsy#readme). Even if you plan to run the website in a container, we strongly recommend pulling in the submodule and other development dependencies by running the following:
2928

3029
```
31-
# install dependencies
32-
yarn
33-
3430
# pull in the Docsy submodule
3531
git submodule update --init --recursive --depth 1
3632
```
@@ -53,6 +49,8 @@ Make sure to install the Hugo extended version specified by the `HUGO_VERSION` e
5349
To build and test the site locally, run:
5450

5551
```bash
52+
# install dependencies
53+
npm ci
5654
make serve
5755
```
5856

0 commit comments

Comments
 (0)