2
0

Dockerfile 665 B

123456789101112131415161718192021222324252627282930
  1. # This Dockerfile is used for building the worker pool binary itself
  2. # Buildtime environment
  3. # -------------------------------------------
  4. FROM golang:1.18-alpine3.16 as build
  5. WORKDIR /app
  6. RUN apk update && apk add gcc binutils-gold musl-dev
  7. COPY go.mod .
  8. COPY go.sum .
  9. COPY /api ./api
  10. COPY /ee ./ee
  11. COPY /internal ./internal
  12. COPY /pkg ./pkg
  13. COPY /provisioner ./provisioner
  14. COPY /workers ./workers
  15. RUN go build -ldflags '-w -s' -tags ee -a -o ./bin/worker-pool ./workers
  16. # Runtime environment
  17. # ----------------------
  18. FROM alpine:3.16
  19. WORKDIR /app
  20. RUN apk update && apk add curl
  21. COPY --from=build /app/bin/worker-pool /usr/bin/
  22. ENTRYPOINT [ "worker-pool" ]