diff --git a/Dockerfile b/Dockerfile index a7ae52a..f0a13dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,9 @@ 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 +# Expect the GOPATH/src volume to be mounted. (-v $GOPATH/src:/src) +VOLUME ["/src"] + # 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 diff --git a/README.md b/README.md index ae05994..fbea3f1 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ To build, run: docker run -v $GOPATH/src:/src mobile /bin/bash -c 'cd /src/your/project && ./make.bash' +Note the use of -v option to mount $GOPATH/src to /src of the container. +The above command will fail if the -v option is missing or the specified +volume is not accessible from the container. + When working with an all-Go application, this will produce a binary at `$GOPATH/src/your/project/bin/name-debug.apk`. You can use the adb tool to install and run this app. See all.bash for an example.