Dockerfile 662 B

12345678910111213141516171819202122232425
  1. FROM golang:1.11-rc as builder
  2. COPY . /src
  3. WORKDIR /src
  4. ENV CGO_ENABLED 0
  5. RUN go get -d ./...
  6. RUN go build -o /assets/in ./cmd/in
  7. RUN go build -o /assets/out ./cmd/out
  8. RUN go build -o /assets/check ./cmd/check
  9. RUN set -e; for pkg in $(go list ./...); do \
  10. go test -o "/tests/$(basename $pkg).test" -c $pkg; \
  11. done
  12. FROM alpine:edge AS resource
  13. RUN apk add --no-cache bash tzdata ca-certificates unzip zip gzip tar
  14. COPY --from=builder assets/ /opt/resource/
  15. RUN chmod +x /opt/resource/*
  16. FROM resource AS tests
  17. COPY --from=builder /tests /tests
  18. ADD . /docker-image-resource
  19. RUN set -e; for test in /tests/*.test; do \
  20. $test -ginkgo.v; \
  21. done
  22. FROM resource