Merge pull request #34112 from sftim/20220602_skip_container_image_build

Avoid recommending a local container image build
pull/34347/head^2
Kubernetes Prow Robot 2022-06-16 22:06:31 -07:00 committed by GitHub
commit 65597a1618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 26 deletions

View File

@ -77,7 +77,7 @@ container-push: container-image ## Push container image for the preview of the w
container-build: module-check
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify --environment development"
container-serve: module-check ## Boot the development server using container. Run `make container-image` before this.
container-serve: module-check ## Boot the development server using container.
$(CONTAINER_RUN) --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
test-examples:

View File

@ -36,10 +36,10 @@ git submodule update --init --recursive --depth 1
## Running the website using a container
To build the site in a container, run the following to build the container image and run it:
To build the site in a container, run the following:
```bash
make container-image
# You can set $CONTAINER_ENGINE to the name of any Docker-like container tool
make container-serve
```

View File

@ -292,34 +292,24 @@ You can either build the website's container image or run Hugo locally. Building
The commands below use Docker as default container engine. Set the `CONTAINER_ENGINE` environment variable to override this behaviour.
{{< /note >}}
1. Build the image locally:
1. Build the container image locally
_You only need this step if you are testing a change to the Hugo tool itself_
```bash
# Run this in a terminal (if required)
make container-image
```
```bash
# Use docker (default)
make container-image
1. Start Hugo in a container:
### OR ###
```bash
# Run this in a terminal
make container-serve
```
# Use podman
CONTAINER_ENGINE=podman make container-image
```
2. After building the `kubernetes-hugo` image locally, build and serve the site:
```bash
# Use docker (default)
make container-serve
### OR ###
# Use podman
CONTAINER_ENGINE=podman make container-serve
```
3. In a web browser, navigate to `https://localhost:1313`. Hugo watches the
1. In a web browser, navigate to `https://localhost:1313`. Hugo watches the
changes and rebuilds the site as needed.
4. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`,
1. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`,
or close the terminal window.
{{% /tab %}}