From e4f5793106c6c884c79bca61c81aa292c6454071 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 7 Nov 2026 09:12:32 -0700 Subject: [PATCH] hugo, clean up the container after compiling hugo with go. --- Config/HugoExample/Dockerfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Config/HugoExample/Dockerfile b/Config/HugoExample/Dockerfile index 2dc5781..4abae33 100644 --- a/Config/HugoExample/Dockerfile +++ b/Config/HugoExample/Dockerfile @@ -10,19 +10,33 @@ USER root ARG DEBIAN_FRONTEND=noninteractive # System Dependencies +run echo "Install Dependencies" RUN apt-get update && \ apt-get install -y \ git nginx cron curl bash sudo \ - golang gcc ca-certificates && \ + ca-certificates \ + golang gcc && \ rm -rf /var/lib/apt/lists/* # Compile Hugo (same version Artix is currently shipping, rather than latest.) +run echo "Compile Hugo" RUN CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.164.0 # Install Hugo +run echo "Install Hugo" RUN mv -v $HOME/go/bin/hugo /usr/local/bin/hugo && \ chmod -v 755 /usr/local/bin/hugo +RUN echo "Clean Up Go" +RUN rm -rfv /usr/local/go \ + /root/go/pkg/mod \ + /root/.cache/go-build \ + /root/go \ + && apt-get remove -y --purge golang gcc && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rfv /var/lib/apt/lists/* /tmp/* + # User and Group #RUN groupadd -r hugo && useradd -r -g hugo hugo