From 384fb70ffbaf4ea9277c1c842c9c00d178af3562 Mon Sep 17 00:00:00 2001 From: Julian Ladisch Date: Fri, 13 Dec 2024 20:52:51 +0100 Subject: [PATCH] Switch from floryn90/hugo to hugomods/hugo image The site build fails since floryn90/hugo v0.134.3: ``` Error: error building site: failed to acquire a build lock: open /src/.hugo_build.lock: permission denied ``` Cause: The Alpine image has switched from root user to hugo user: https://github.com/floryn90/docker-hugo/commit/b26163074781850eba0151306837c55f8a2b5b1e Fix: Switch to hugomods/hugo image that still runs as root user. The hugomods/hugo:std-exts image has git included making our Dockerfile obsolete. --- Dockerfile | 4 ---- README.md | 12 ++---------- docker-compose.yaml | 13 ++++++------- 3 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 232d8f70c4e..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM floryn90/hugo:ext-alpine - -RUN apk add git && \ - git config --global --add safe.directory /src diff --git a/README.md b/README.md index ecf41558592..a8653665dce 100644 --- a/README.md +++ b/README.md @@ -69,20 +69,12 @@ than [Docker Desktop](https://www.docker.com/products/docker-desktop) on Windows and Mac, and [Docker Compose](https://docs.docker.com/compose/install/) on Linux. -1. Build the docker image - - ```bash - docker-compose build - ``` - -1. Run the built image +1. Spin up the service ```bash docker-compose up ``` - > NOTE: You can run both commands at once with `docker-compose up --build`. - 1. Verify that the service is working. Open your web browser and type `http://localhost:1313` in your navigation bar, @@ -94,7 +86,7 @@ on Linux. To stop Docker Compose, on your terminal window, press **Ctrl + C**. -To remove the produced images run: +To remove the produced container run: ```bash docker-compose rm diff --git a/docker-compose.yaml b/docker-compose.yaml index 9069dc06798..e8443444fb1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,11 +3,10 @@ version: "3.8" services: site: - image: docsy/docsy-example - build: - context: . - command: server - ports: - - "1313:1313" + image: hugomods/hugo:std-exts + command: server -D volumes: - - .:/src + - ./:/src + - ~/hugo_cache:/tmp/hugo_cache + ports: + - 1313:1313