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 {#docker-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:
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
90
+
{{< /code >}}
91
+
92
+
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:
99
+
100
+
{{< code copy=true >}}
101
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
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:
|Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:[^1]
117
+
|Easy to upgrade?|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
118
+
|Easy to downgrade?|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
119
+
|Automatic updates?|:x:|varies|:x:|:x:
120
+
|Latest version available?|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
121
+
122
+
[^1]: Docker containers do not require installation, but you must install Docker before you can run a container. See the [prerequisites](#docker-prerequisites) section above.
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 {#docker-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:
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
208
+
{{< /code >}}
209
+
210
+
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:
217
+
218
+
{{< code copy=true >}}
219
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
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.
|Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:[^3]
235
+
|Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
236
+
|Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark:[^1]|varies|:heavy_check_mark:|:heavy_check_mark:
237
+
|Automatic updates?|:x:|varies [^2]|:x:|:x:|:x:
238
+
|Latest version available?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
193
239
194
240
[^1]: Easy if a previous version is still installed.
195
241
[^2]: Snap packages are automatically updated. Homebrew requires advanced configuration.
242
+
[^3]: Docker containers do not require installation, but you must install Docker Desktop or Docker Engine before you can run a container. See the [prerequisites](#docker-prerequisites) section above.
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 {#docker-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:
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
58
+
{{< /code >}}
59
+
60
+
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:
67
+
68
+
{{< code copy=true >}}
69
+
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
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.
|Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:[^3]
85
+
|Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
86
+
|Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark:[^1]|:heavy_check_mark:|:heavy_check_mark:
87
+
|Automatic updates?|:x:|:x:[^2]|:x:|:x:
88
+
|Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
44
89
45
90
[^1]: Easy if a previous version is still installed.
46
91
[^2]: Possible but requires advanced configuration.
92
+
[^3]: Docker containers do not require installation, but you must install Docker Desktop before you can run a container. See the [prerequisites](#docker-prerequisites) section above.
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:
docker run --rm -v .:/project -v $Env:LocalAppData/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
91
+
{{< /code >}}
92
+
93
+
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:
100
+
101
+
{{< code copy=true >}}
102
+
docker run --rm -v .:/project -v $Env:LocalAppData/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
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.
|Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:[^3]
118
+
|Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
119
+
|Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark:[^2]|:heavy_check_mark:|:heavy_check_mark:
120
+
|Automatic updates?|:x:|:x:[^1]|:x:|:x:
121
+
|Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
71
122
72
123
[^1]: Possible but requires advanced configuration.
73
124
[^2]: Easy if a previous version is still installed.
125
+
[^3]: Docker containers do not require installation, but you must install Docker Desktop before you can run a container. See the [prerequisites](#docker-prerequisites) section above.
0 commit comments