You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6 KiB

4 years ago
  1. #
  2. # Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
  3. #
  4. # This file is part of After Dark.
  5. #
  6. # After Dark is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Affero General Public License as published
  8. # by the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # After Dark is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Affero General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Affero General Public License
  17. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. #
  19. # DOCKER-VERSION 19.03.1-ce, build 74b1e89e8a
  20. # Specify build image
  21. ARG GO_VERSION=1.11.4
  22. ARG BUILD_TARGET=alpine3.8
  23. # Pull builder base image
  24. FROM golang:${GO_VERSION}-${BUILD_TARGET} AS htmltestbuilder
  25. # Set build variables
  26. ARG HTMLTEST_VERSION=0.10.3
  27. ENV CGO_ENABLED=0 \
  28. GOOS=linux \
  29. GO111MODULE=on
  30. # Build from source using specified version
  31. RUN \
  32. apk add --update --no-cache ca-certificates git musl-dev && \
  33. git clone https://github.com/wjdp/htmltest.git $GOPATH/src/github.com/wjdp/htmltest && \
  34. cd ${GOPATH:-$HOME/go}/src/github.com/wjdp/htmltest && \
  35. git checkout v$HTMLTEST_VERSION && \
  36. go mod download && \
  37. go install -installsuffix 'static' -ldflags "-X main.date=`date -u +%Y-%m-%dT%H:%M:%SZ` -X main.version=`git describe --tags`"
  38. # Move compiled binary into own container
  39. FROM scratch
  40. COPY --from=htmltestbuilder /go/bin/htmltest /htmltest
  41. ENTRYPOINT ["/htmltest"]
  42. CMD ["-h"]