Dockerfile 372 B

12345678910111213141516171819
  1. # STEP 1: Build sqlc
  2. FROM golang:1.17.7 AS builder
  3. COPY . /workspace
  4. WORKDIR /workspace
  5. ARG github_ref
  6. ARG github_sha
  7. ARG version
  8. ENV GITHUB_REF=$github_ref
  9. ENV GITHUB_SHA=$github_sha
  10. ENV VERSION=$version
  11. RUN go run scripts/release.go -docker
  12. # STEP 2: Build a tiny image
  13. FROM scratch
  14. COPY --from=builder /workspace/sqlc /workspace/sqlc
  15. ENTRYPOINT ["/workspace/sqlc"]