-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to latest Go version + Some Docker image improvements (note)
* Rename /site to /project * Add ldflags * Add go and node to the default image * Build the extended version by default * Add "npm i" install support with custom entry script override * Adjust cache logic to speed up CGO rebuilds Closes #12920 See #12885
- Loading branch information
Showing
4 changed files
with
96 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache -u $(id -u):$(id -g) testing_bullseye build | ||
|
||
|
||
docker build -t testing_alpine . | ||
|
||
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache -p 1313:1313 testing_alpine server --bind="0.0.0.0" | ||
|
||
|
||
This is the entry point file: | ||
|
||
```sh | ||
#!/bin/sh | ||
|
||
# Check if a custom hugo-docker-entrypoint.sh file exists. | ||
if [ -f hugo-docker-entrypoint.sh ]; then | ||
# Execute the custom entrypoint file. | ||
sh hugo-docker-entrypoint.sh "$@" | ||
exit $? | ||
fi | ||
|
||
# Check if a package.json file exists. | ||
if [ -f package.json ]; then | ||
# Check if node_modules exists. | ||
if [ ! -d node_modules ]; then | ||
# Install npm packages. | ||
npm i | ||
fi | ||
fi | ||
|
||
exec "hugo" "$@" | ||
``` | ||
|
||
If a custom `hugo-docker-entrypoint.sh` script exists in the root of the Hugo project, that script will be executed instead of the default entrypoint script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# Check if a custom hugo-docker-entrypoint.sh file exists. | ||
if [ -f hugo-docker-entrypoint.sh ]; then | ||
# Execute the custom entrypoint file. | ||
sh hugo-docker-entrypoint.sh "$@" | ||
exit $? | ||
fi | ||
|
||
# Check if a package.json file exists. | ||
if [ -f package.json ]; then | ||
# Check if node_modules exists. | ||
if [ ! -d node_modules ]; then | ||
# Install npm packages. | ||
npm i | ||
fi | ||
fi | ||
|
||
exec "hugo" "$@" |