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-7Lines changed: 54 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,12 +69,59 @@ doas pkg_add hugo
69
69
70
70
{{% include "installation/_common/04-build-from-source.md" %}}
71
71
72
+
## Docker container
73
+
74
+
### Prerequisites {#docker-prerequisites}
75
+
76
+
Before running the Docker container locally you must install Docker. See the [installation instructions].
77
+
78
+
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.
79
+
80
+
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
95
+
{{< /code >}}
96
+
97
+
To build your site and start the embedded web server using the latest version:
98
+
99
+
{{< code copy=true >}}
100
+
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"
101
+
{{< /code >}}
102
+
103
+
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:
104
+
105
+
{{< code copy=true >}}
106
+
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.
114
+
115
+
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.
116
+
72
117
## Comparison
73
118
74
-
||Prebuilt binaries|Repository packages|Build from source
75
-
:--|:--:|:--:|:--:
76
-
Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
77
-
Easy to upgrade?|:heavy_check_mark:|varies|:heavy_check_mark:
78
-
Easy to downgrade?|:heavy_check_mark:|varies|:heavy_check_mark:
79
-
Automatic updates?|:x:|varies|:x:
80
-
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]
122
+
|Easy to upgrade?|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
123
+
|Easy to downgrade?|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
124
+
|Automatic updates?|:x:|varies|:x:|:x:
125
+
|Latest version available?|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
126
+
127
+
[^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-7Lines changed: 54 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,15 +203,62 @@ sudo xbps-install -S hugo
203
203
204
204
{{% include "installation/_common/04-build-from-source.md" %}}
205
205
206
+
## Docker container
207
+
208
+
### Prerequisites {#docker-prerequisites}
209
+
210
+
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].
211
+
212
+
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.
213
+
214
+
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
230
+
{{< /code >}}
231
+
232
+
To build your site and start the embedded web server using the latest version:
233
+
234
+
{{< code copy=true >}}
235
+
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"
236
+
{{< /code >}}
237
+
238
+
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:
239
+
240
+
{{< code copy=true >}}
241
+
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.
249
+
250
+
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]
257
+
|Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
258
+
|Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark:[^1]|varies|:heavy_check_mark:|:heavy_check_mark:
259
+
|Automatic updates?|:x:|varies [^2]|:x:|:x:|:x:
260
+
|Latest version available?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
215
261
216
262
[^1]: Easy if a previous version is still installed.
217
263
[^2]: Snap packages are automatically updated. Homebrew requires advanced configuration.
264
+
[^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-7Lines changed: 53 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,15 +37,61 @@ sudo port install hugo
37
37
38
38
{{% include "installation/_common/04-build-from-source.md" %}}
39
39
40
+
## Docker container
41
+
42
+
### Prerequisites {#docker-prerequisites}
43
+
44
+
Before running the Docker container locally you must install Docker Desktop. See the [installation instructions].
45
+
46
+
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.
47
+
48
+
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
63
+
{{< /code >}}
64
+
65
+
To build your site and start the embedded web server using the latest version:
66
+
67
+
{{< code copy=true >}}
68
+
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"
69
+
{{< /code >}}
70
+
71
+
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:
72
+
73
+
{{< code copy=true >}}
74
+
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.
82
+
83
+
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]
90
+
|Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
91
+
|Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark:[^1]|:heavy_check_mark:|:heavy_check_mark:
92
+
|Automatic updates?|:x:|:x:[^2]|:x:|:x:
93
+
|Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
49
94
50
95
[^1]: Easy if a previous version is still installed.
51
96
[^2]: Possible but requires advanced configuration.
97
+
[^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].
83
+
84
+
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.
85
+
86
+
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
101
+
{{< /code >}}
102
+
103
+
To build your site and start the embedded web server using the latest version:
104
+
105
+
{{< code copy=true >}}
106
+
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"
107
+
{{< /code >}}
108
+
109
+
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:
110
+
111
+
{{< code copy=true >}}
112
+
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.
120
+
121
+
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]
128
+
|Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
129
+
|Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark:[^2]|:heavy_check_mark:|:heavy_check_mark:
130
+
|Automatic updates?|:x:|:x:[^1]|:x:|:x:
131
+
|Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
81
132
82
133
[^1]: Possible but requires advanced configuration.
83
134
[^2]: Easy if a previous version is still installed.
135
+
[^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