From de1a4058f972094485a77e02b0948c729e40b323 Mon Sep 17 00:00:00 2001 From: Andreas Linde <42185+DerAndereAndi@users.noreply.github.com> Date: Sun, 2 Oct 2022 18:11:21 +0200 Subject: [PATCH] Attempt to make the asn1 patch work in docker (#4695) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assumption is that there is write access without sudo, as running `sudo patch …` causes the following error: ``` #26 0.112 sudo patch -N -t -d /usr/local/go/src/vendor/golang.org/x/crypto/cryptobyte -i /build/patch/asn1.diff 289 #26 0.112 make: sudo: No such file or directory ``` --- Dockerfile | 2 +- Makefile | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49bebb5f6..52adac660 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN go mod download # prepare COPY . . -RUN make patch-asn1 +RUN make patch-asn1-docker RUN make assets # copy ui diff --git a/Makefile b/Makefile index a1272747d..af8300312 100644 --- a/Makefile +++ b/Makefile @@ -135,3 +135,9 @@ patch-asn1:: cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true" sudo patch -N -t -d $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte -i $(CURRDIR)/patch/asn1.diff cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true" + +patch-asn1-docker:: + # echo $(GOROOT) + cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true" + patch -N -t -d $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte -i $(CURRDIR)/patch/asn1.diff + cat $(GOROOT)/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go | grep -C 1 "out = true"