We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8e06fc commit 57cea91Copy full SHA for 57cea91
build-custom.sh
@@ -0,0 +1,9 @@
1
+set -eou pipefail
2
+
3
+GIT_SHA=$(git rev-parse --short HEAD)
4
+LD_FLAGS_VERSION="-X github.com/kyleconroy/sqlc/internal/cmd.version=custom-${GIT_SHA}"
5
6
+export CGO_ENABLED=1
7
8
+set -x
9
+go build -v -o pkg/sqlc -ldflags "-extldflags \"-static\" ${LD_FLAGS_VERSION}" ./cmd/sqlc
custom.Dockerfile
@@ -0,0 +1,10 @@
+FROM golang:1.15 as builder
+COPY . /workspace
+WORKDIR /workspace
+RUN /bin/bash build-custom.sh
+FROM scratch
+COPY --from=builder /workspace/pkg/sqlc /sqlc
10
+ENTRYPOINT ["/sqlc"]
0 commit comments