Skip to content

Commit 65597a1

Browse files
authored
Merge pull request #34112 from sftim/20220602_skip_container_image_build
Avoid recommending a local container image build
2 parents 014979f + a531bcc commit 65597a1

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ container-push: container-image ## Push container image for the preview of the w
7777
container-build: module-check
7878
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify --environment development"
7979

80-
container-serve: module-check ## Boot the development server using container. Run `make container-image` before this.
80+
container-serve: module-check ## Boot the development server using container.
8181
$(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
8282

8383
test-examples:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ git submodule update --init --recursive --depth 1
3636

3737
## Running the website using a container
3838

39-
To build the site in a container, run the following to build the container image and run it:
39+
To build the site in a container, run the following:
4040

4141
```bash
42-
make container-image
42+
# You can set $CONTAINER_ENGINE to the name of any Docker-like container tool
4343
make container-serve
4444
```
4545

content/en/docs/contribute/new-content/open-a-pr.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -292,34 +292,24 @@ You can either build the website's container image or run Hugo locally. Building
292292
The commands below use Docker as default container engine. Set the `CONTAINER_ENGINE` environment variable to override this behaviour.
293293
{{< /note >}}
294294

295-
1. Build the image locally:
295+
1. Build the container image locally
296+
_You only need this step if you are testing a change to the Hugo tool itself_
297+
```bash
298+
# Run this in a terminal (if required)
299+
make container-image
300+
```
296301

297-
```bash
298-
# Use docker (default)
299-
make container-image
300-
301-
### OR ###
302-
303-
# Use podman
304-
CONTAINER_ENGINE=podman make container-image
305-
```
306-
307-
2. After building the `kubernetes-hugo` image locally, build and serve the site:
302+
1. Start Hugo in a container:
308303

309-
```bash
310-
# Use docker (default)
311-
make container-serve
312-
313-
### OR ###
314-
315-
# Use podman
316-
CONTAINER_ENGINE=podman make container-serve
317-
```
304+
```bash
305+
# Run this in a terminal
306+
make container-serve
307+
```
318308

319-
3. In a web browser, navigate to `https://localhost:1313`. Hugo watches the
309+
1. In a web browser, navigate to `https://localhost:1313`. Hugo watches the
320310
changes and rebuilds the site as needed.
321311

322-
4. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`,
312+
1. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`,
323313
or close the terminal window.
324314

325315
{{% /tab %}}

0 commit comments

Comments
 (0)