Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

42 lines
1.2KB

  1. #
  2. # Hugo Dockerfile for After Dark
  3. #
  4. # After Dark is free and open source software you can use to create a
  5. # privacy-aware website, blog or app.
  6. #
  7. # Read the docs (https://after-dark.habd.as/)
  8. # View the code (https://git.habd.as)
  9. #
  10. # Copyright (C) 2018 Josh Habdas <[email protected]>
  11. #
  12. # This work is free. You can redistribute it and/or modify it under the
  13. # terms of the Do What The Fuck You Want To Public License, Version 2,
  14. # as published by Sam Hocevar. See the COPYING file for more details.
  15. #
  16. # DOCKER-VERSION 17.12.0-ce, build c97c6d6
  17. # Pull hugo builder base image
  18. FROM golang:1.10.3-alpine3.7 AS hugobuilder
  19. # Set environment variables for hugo build
  20. ENV HUGO_VERSION=0.44 \
  21. CGO_ENABLED=0 \
  22. GOOS=linux
  23. # Build hugo from source using specified version
  24. RUN \
  25. apk add --update --no-cache git musl-dev && \
  26. git clone https://github.com/gohugoio/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \
  27. cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo && \
  28. git checkout v$HUGO_VERSION && \
  29. go get github.com/golang/dep/cmd/dep && \
  30. dep ensure -vendor-only && \
  31. go install -ldflags '-s -w'
  32. # Move compiled binary into own container
  33. FROM scratch
  34. COPY --from=hugobuilder /go/bin/hugo /hugo
  35. ENTRYPOINT ["/hugo"]
  36. CMD ["--help"]