You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/en/installation/bsd.md
+54-7
Original file line number
Diff line number
Diff line change
@@ -64,12 +64,59 @@ doas pkg_add hugo
64
64
65
65
{{% include "installation/_common/04-build-from-source.md" %}}
66
66
67
+
## Docker container
68
+
69
+
### Prerequisites
70
+
71
+
Before running the Docker container locally you must install Docker. See the [installation instructions].
72
+
73
+
When building your production site in a [CI/CD] workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
74
+
75
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
To build your site and start the embedded web server using the latest version:
93
+
94
+
{{< code copy=true >}}
95
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
96
+
{{< /code >}}
97
+
98
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
109
+
110
+
If you are using a custom Hugo cache directory, in the commands above replace `$HOME/.cache/hugo_cache` with the absolute path to your cache directory.
111
+
67
112
## Comparison
68
113
69
-
||Prebuilt binaries|Repository packages|Build from source
70
-
:--|:--:|:--:|:--:
71
-
Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
72
-
Easy to upgrade?|:heavy_check_mark:|varies|:heavy_check_mark:
73
-
Easy to downgrade?|:heavy_check_mark:|varies|:heavy_check_mark:
74
-
Automatic updates?|:x:|varies|:x:
75
-
Latest version available?|:heavy_check_mark:|varies|:heavy_check_mark:
Copy file name to clipboardexpand all lines: content/en/installation/linux.md
+54-7
Original file line number
Diff line number
Diff line change
@@ -181,15 +181,62 @@ sudo eopkg install hugo
181
181
182
182
{{% include "installation/_common/04-build-from-source.md" %}}
183
183
184
+
## Docker container
185
+
186
+
### Prerequisites
187
+
188
+
Before running the Docker container locally you must install Docker Desktop or Docker Engine. See the installation instructions for either [Docker Desktop] or [Docker Engine].
189
+
190
+
When building your production site in a [CI/CD] workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
191
+
192
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
To build your site and start the embedded web server using the latest version:
211
+
212
+
{{< code copy=true >}}
213
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
214
+
{{< /code >}}
215
+
216
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
227
+
228
+
If you are using a custom Hugo cache directory, in the commands above replace `$HOME/.cache/hugo_cache` with the absolute path to your cache directory.
Copy file name to clipboardexpand all lines: content/en/installation/macos.md
+53-7
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,61 @@ sudo port install hugo
32
32
33
33
{{% include "installation/_common/04-build-from-source.md" %}}
34
34
35
+
## Docker container
36
+
37
+
### Prerequisites
38
+
39
+
Before running the Docker container locally you must install Docker Desktop. See the [installation instructions].
40
+
41
+
When building your production site in a [CI/CD] workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
42
+
43
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
To build your site and start the embedded web server using the latest version:
61
+
62
+
{{< code copy=true >}}
63
+
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
64
+
{{< /code >}}
65
+
66
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
77
+
78
+
If you are using a custom Hugo cache directory, in the commands above replace `$HOME/Library/Caches/hugo_cache` with the absolute path to your cache directory.
Before running the Docker container locally you must install Docker Desktop. See the [installation instructions].
73
+
74
+
When building your production site in a [CI/CD] workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
75
+
76
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
To build your site and start the embedded web server using the latest version:
94
+
95
+
{{< code copy=true >}}
96
+
docker run --rm -v .:/project -v $Env:LocalAppData/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
97
+
{{< /code >}}
98
+
99
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
110
+
111
+
If you are using a custom Hugo cache directory, in the commands above replace `%LocalAppData%/hugo_cache` with the absolute path to your cache directory.
0 commit comments