Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local build with docker #1

Open
yangcyself opened this issue Mar 18, 2023 · 0 comments
Open

Local build with docker #1

yangcyself opened this issue Mar 18, 2023 · 0 comments

Comments

@yangcyself
Copy link
Collaborator

I created and tested with the following docker file so that we can build the website locally, which improves our productivity.

# Use the ubuntu image as the base image
FROM ubuntu AS builder

# Install the necessary build dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y wget tar bash git golang-go npm nodejs vim

# Set the environment variable for the version of Hugo you want to build
ENV HUGO_VERSION=0.111.3

RUN wget -q -O /tmp/hugo_extended.tar.gz \
    https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz && \
    tar -xzf /tmp/hugo_extended.tar.gz -C /usr/local/bin && \
    rm /tmp/hugo_extended.tar.gz

# Hugo dev server port
EXPOSE 1313

## Build with the following (in the path of the docker file)
# docker build -t my-hugo-extended:latest .
## Run with the following (in the path of acssz.github.io)
# docker run --rm -it -v $(pwd):/src -p 1313:1313 -w /src  my-hugo-extended:latest hugo server --bind 0.0.0.0

reference install-hugo-extended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant