Skip to content

Commit

Permalink
Import Containerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad committed Dec 3, 2024
1 parent 1c257cb commit 0c44572
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
16 changes: 16 additions & 0 deletions containers/Containerfile
Original file line number Diff line number Diff line change
@@ -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"]
35 changes: 35 additions & 0 deletions containers/README.md
Original file line number Diff line number Diff line change
@@ -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 .
```

0 comments on commit 0c44572

Please sign in to comment.