mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
8531ec7ca3
- Hugo container is based on SCRATCH to further reduce the footprint and the vulnerability surface - Update Alpine image to 3.7 in the build container - Update Go Lang to 1.10 in the build container - Add .dockerignore file per the Docker best practices Closes #4154, #4155, #4157
27 lines
574 B
Docker
27 lines
574 B
Docker
# GitHub: https://github.com/gohugoio
|
|
# Twitter: https://twitter.com/gohugoio
|
|
# Website: https://gohugo.io/
|
|
|
|
FROM golang:1.10.0-alpine3.7 AS build
|
|
|
|
ENV CGO_ENABLED=0
|
|
ENV GOOS=linux
|
|
|
|
WORKDIR /go/src/github.com/gohugoio/hugo
|
|
RUN apk add --no-cache \
|
|
git \
|
|
musl-dev && \
|
|
go get github.com/golang/dep/cmd/dep
|
|
COPY . /go/src/github.com/gohugoio/hugo/
|
|
RUN dep ensure -vendor-only && \
|
|
go install -ldflags '-s -w'
|
|
|
|
# ---
|
|
|
|
FROM scratch
|
|
COPY --from=build /go/bin/hugo /hugo
|
|
WORKDIR /site
|
|
VOLUME /site
|
|
EXPOSE 1313
|
|
ENTRYPOINT [ "/hugo" ]
|
|
CMD [ "--help" ]
|