Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. # Update the NODE_VERSION arg in docker-compose.yml to pick a Node version: 10, 12, 14
  2. ARG NODE_VERSION=14
  3. FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${NODE_VERSION}
  4. # VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
  5. ARG VARIANT=hugo
  6. # VERSION can be either 'latest' or a specific version number
  7. ARG VERSION=latest
  8. # Download Hugo
  9. RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \
  10. rm -rf /var/lib/apt/lists/* && \
  11. case ${VERSION} in \
  12. latest) \
  13. export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\
  14. esac && \
  15. echo ${VERSION} && \
  16. wget -O ${VERSION}.tar.gz https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${VARIANT}_${VERSION}_Linux-64bit.tar.gz && \
  17. tar xf ${VERSION}.tar.gz && \
  18. mv hugo /usr/bin/hugo
  19. # Hugo dev server port
  20. EXPOSE 1313
  21. # [Optional] Uncomment this section to install additional OS packages you may want.
  22. #
  23. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
  24. # && apt-get -y install --no-install-recommends <your-package-list-here>
  25. # [Optional] Uncomment if you want to install more global node packages
  26. # RUN sudo -u node npm install -g <your-package-list-here>