Update debug dockerfile for go1.19
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM golang:1.13.15 as builder
+FROM golang:1.19 as builder
WORKDIR /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
ADD . .
-RUN CGO_ENABLED=0 go get -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv
-RUN GCE_PD_CSI_DEBUG=1 make gce-pd-driver
+ARG STAGINGVERSION
+ARG TARGETPLATFORM
+
+RUN CGO_ENABLED=0 go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@latest
+
+RUN GOARCH="$(echo $TARGETPLATFORM | cut -f2 -d '/')" GCE_PD_CSI_STAGING_VERSION=$STAGINGVERSION GCE_PD_CSI_DEBUG=1 make gce-pd-driver
# MAD HACKS: Build a version first so we can take the scsi_id bin and put it somewhere else in our real build
FROM k8s.gcr.io/build-image/debian-base-amd64:buster-v1.5.0 as mad-hack
