Build hugo fully from source on alpine
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
1b07cb236d
commit
c84f0fecba
1 changed files with 10 additions and 8 deletions
18
Dockerfile
18
Dockerfile
|
@ -1,13 +1,15 @@
|
|||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache go libc6-compat
|
||||
FROM golang:1.20-alpine as builder
|
||||
|
||||
ARG HUGO_VERSION
|
||||
|
||||
RUN wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" && \
|
||||
tar -xf "hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" && \
|
||||
mv ./hugo /usr/bin/hugo && \
|
||||
rm -rf "hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz"
|
||||
ENV CGO_ENABLED=1
|
||||
|
||||
CMD ["/usr/bin/hugo"]
|
||||
RUN apk add --no-cache git build-base && \
|
||||
go install -tags extended github.com/gohugoio/hugo@v$HUGO_VERSION
|
||||
|
||||
FROM golang:1.20-alpine
|
||||
|
||||
RUN apk add libstdc++
|
||||
COPY --from=builder /go/bin/hugo /go/bin/hugo
|
||||
|
||||
CMD ["/go/bin/hugo"]
|
||||
|
|
Loading…
Reference in a new issue