diff --git a/containers/Containerfile b/containers/Containerfile new file mode 100644 index 0000000..72404ad --- /dev/null +++ b/containers/Containerfile @@ -0,0 +1,16 @@ +FROM registry.fedoraproject.org/fedora:40 AS downloader + + +RUN curl -L https://github.com/gohugoio/hugo/releases/download/v0.127.0/hugo_0.127.0_Linux-64bit.tar.gz -o hugo.tar.gz \ + && tar -zxvf hugo.tar.gz + + +FROM registry.fedoraproject.org/fedora:40 + +COPY --from=downloader /hugo /usr/bin + +RUN mkdir -p /workspace +VOLUME /workspace +WORKDIR /workspace + +ENTRYPOINT ["/usr/bin/hugo"] \ No newline at end of file diff --git a/containers/README.md b/containers/README.md new file mode 100644 index 0000000..a1fe8b6 --- /dev/null +++ b/containers/README.md @@ -0,0 +1,35 @@ +Fedora image for Hugo-based generation +====================================== + + +This Fedora container image contains: + + - hugo: https://github.com/gohugoio/hugo + The world’s fastest framework for building websites + + +## Usage instructions +Start the container in the folder that contains your blog source + +```bash +$ podman run --rm -v $PWD:/workspace \ + ghcr.io/gbraad-redhat/hugo:0.127.0 --minify +``` + +This will generate a `public` output. + +Or using + +```bash +$ podman run --rm -v $PWD:/workspace -p 1313:1313 \ + ghcr.io/gbraad-redhat/hugo:0.127.0 \ + server --bind 0.0.0.0 +``` +the generated content will be published using the embedded server on http://localhost:1313 + + +## Build container + +```bash +$ podman build -t hugo -f Containerfile . +```