Sign inSign up

nunix/gohugo

By nunix

•Updated almost 8 years ago

GoHugo image with automatic latest built (see Dockerfile)

Image
0

1.1K

nunix/gohugo repository overview

LINUX DOCKERFILE FROM alpine as builder RUN apk add curl wget jq WORKDIR /tmp RUN curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest⁠ | jq -r ".assets[] | select(.name | contains("Linux-64bit.tar.gz")) | .browser_download_url" | grep -v extended | wget -qi - RUN tar -xzf hugo*.tar.gz

FROM alpine WORKDIR /usr/bin/ COPY --from=builder /tmp/hugo . WORKDIR /docs ENTRYPOINT ["hugo","server"] CMD ["--bind=0.0.0.0","-w"]

LINUX USAGE docker run -it -p 1313:1313 -v /docs:/docs nunix/gohugo

WINDOWS DOCKERFILE FROM microsoft/windowsservercore:1803 as builder RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1⁠'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" RUN choco.exe install curl wget jq -y WORKDIR "C:\" RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "wget.exe $(curl.exe -s https://api.github.com/repos/gohugoio/hugo/releases/latest⁠ | jq.exe -r '.assets[] | select(.name | contains("""Windows-64bit.zip""")) | .browser_download_url' | Select-String 'extended' -NotMatch)" RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "Expand-Archive -DestinationPath C:\ -Path c:\hugo_*.zip"

FROM microsoft/nanoserver:1803 WORKDIR "C:\" COPY --from=builder C:\hugo.exe . WORKDIR "C:\docs" ENTRYPOINT ["C:\hugo.exe", "server"] CMD ["--bind=0.0.0.0", "-w"]

WINDOWS USAGE docker run -it -p 1313:1313 -v C:<PATH to ATHENS>\docs:c:\docs nunix/gohugo:nanoserver

Tag summary

Content type

Image

Digest

Size

9.4 MB

Last updated

almost 8 years ago

docker pull nunix/gohugo