From 1e525d6eb2cd184a0978135f0c382373af965792 Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Sat, 3 Jan 2015 11:42:09 -0800 Subject: [PATCH] mobile: cache debug.keystore to avoid adb install certificate errors Otherwise, successive adb installs will require the existing apk to be removed. If no android.keystore is generated during docker build, one will be generated by the NDK toolchain during docker run. It will end up the applications are being signed with different certificates on each docker run. Fixes #9498. Change-Id: Ibac202b828224287ec6fdc3eaff659de5fce61c3 Reviewed-on: https://go-review.googlesource.com/2266 Reviewed-by: David Crawshaw --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6b86a7a..a7ae52a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,4 +59,8 @@ RUN curl -L https://github.com/golang/go/archive/master.zip -o /tmp/go.zip && \ ./all.bash && \ CC_FOR_TARGET=$NDK_ROOT/bin/arm-linux-androideabi-gcc GOOS=android GOARCH=arm GOARM=7 ./make.bash +# Generate a debug keystore to avoid it being generated on each `docker run` +# and fail `adb install -r ` with a conflicting certificate error. +RUN keytool -genkeypair -alias androiddebugkey -keypass android -keystore ~/.android/debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 365 + WORKDIR $GOPATH/src/golang.org/x/mobile