Coder Social home page Coder Social logo

pmudra / docker-hugo Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 12 KB

Extremely Lightweight Docker Images for the Static Site Generator Hugo

License: Apache License 2.0

Python 100.00%
hugo docker-image dockerfile continuous-integration static-site automated-build alpine-image docker-hugo hugo-cli hugo-site

docker-hugo's Introduction

Hugo Docker Images

Docker Build Status Docker Pulls Docker Stars

Extremely lightweight (< 10 MB) Docker images for the static site generator Hugo.

How to use this image

Basically, the Hugo Docker image is used the same way as the Hugo CLI itself. See the official basic usage page for a more detailed explanation.

Get help and version

$ docker run --rm pmudra/hugo hugo help
$ docker run --rm pmudra/hugo hugo version
Command/Option Description
docker run Run a command in a new container
--rm Automatically remove the container when it exits
pmudra/hugo Name of the Hugo Docker image
hugo Execute Hugo CLI
help/version Hugo CLI commands (i.e. same as running hugo help/hugo version)

Create a new site

$ docker run --rm --mount type=bind,source="$(pwd)",target=/usr/src/myapp -w /usr/src/myapp pmudra/hugo hugo new site quickstart
Command/Option Description
--mount type=bind, Attach a filesystem mount to the container
source="$(pwd)", Path to the directory on the host i.e. the path of the current working directory
target=/usr/src/myapp Path where the directory will be mounted in the container
-w /usr/src/myapp Working directory inside the container
new site quickstart Create a new Hugo site named quickstart

The above will create a new Hugo site in a folder named quickstart.

Serve content

$ cd quickstart
$ docker run -it --rm --mount type=bind,source="$(pwd)",target=/usr/src/myapp -w /usr/src/myapp -p 1313:1313 pmudra/hugo hugo server --bind=0.0.0.0
Command/Option Description
-it Keep STDIN open even if not attached and allocate a pseudo-TTY
-p 1313:1313 Publish the container's port to the host
--bind=0.0.0.0 Bind to all interfaces (this enables the docker host to access the site)

The above builds and serves the site. Web Server is available at http://localhost:1313/.

Remember to add a theme before expecting to see anything else than a blank page.

docker-hugo's People

Contributors

pmudra avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.