Simple scheduling for short-running Docker containers https://blog.iamthefij.com/2018/11/19/introducing-dockron-scheduling/
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.

Dockerfile.multi-stage 452B

1234567891011121314151617181920212223
  1. ARG REPO=library
  2. FROM golang:1.12-alpine AS builder
  3. RUN apk add --no-cache git
  4. RUN mkdir /app
  5. WORKDIR /app
  6. COPY ./go.mod ./go.sum /app/
  7. RUN go mod download
  8. COPY ./main.go /app/
  9. ARG ARCH=amd64
  10. ARG VERSION=dev
  11. ENV CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH}
  12. RUN go build -ldflags "-X main.version=${VERSION}" -a -installsuffix nocgo -o dockron .
  13. FROM ${REPO}/busybox:latest
  14. WORKDIR /root/
  15. COPY --from=builder /app/dockron .
  16. ENTRYPOINT [ "./dockron" ]