Compare commits

..

No commits in common. "main" and "sarah-patch-1" have entirely different histories.

2 changed files with 24 additions and 9 deletions

View File

@ -36,8 +36,8 @@ RUN ln -sf $ANDROID_HOME/ndk/$NDK_VER $ANDROID_HOME/ndk-bundle
## - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
ENV GOLANG_VERSION=1.21.5.linux-amd64
ENV GOLANG_SHA256=e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e
ENV GOLANG_VERSION=1.19.3
ENV GOLANG_SHA256=18ac263e39210bcf68d85f4370e97fb1734166995a1f63fb38b4f6e07d90d212
RUN set -eux; \
apt-get update; \
@ -49,11 +49,32 @@ RUN set -eux; \
golang \
; \
rm -rf /var/lib/apt/lists/*; \
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.tar.gz"; \
export \
## set GOROOT_BOOTSTRAP such that we can actually build Go
GOROOT_BOOTSTRAP="$(go env GOROOT)" \
## ... and set "cross-building" related vars to the installed system's values so that we create a build targeting the proper arch
## (for example, if our build host is GOARCH=amd64, but our build env/image is GOARCH=386, our build needs GOARCH=386)
GOOS="$(go env GOOS)" \
GOARCH="$(go env GOARCH)" \
GOHOSTOS="$(go env GOHOSTOS)" \
GOHOSTARCH="$(go env GOHOSTARCH)" \
; \
## also explicitly set GO386 and GOARM if appropriate
## https://github.com/docker-library/golang/issues/184
aptArch="$(dpkg-architecture -q DEB_BUILD_GNU_CPU)"; \
case "$aptArch" in \
arm) export GOARM='6' ;; \
x86_64) export GO386='387' ;; \
esac; \
\
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
echo "$GOLANG_SHA256 *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
\
cd /usr/local/go/src; \
./make.bash; \
\
export PATH="/usr/local/go/bin:$PATH"; \
go version

View File

@ -1,17 +1,11 @@
# Android, Go, and gomobile
**Deprecated:** in favor of [go-cross-compile](https://git.openprivacy.ca/openprivacy/go-cross-compile) at [dockerhub/openpriv/go-cross-compile](https://hub.docker.com/r/openpriv/go-cross-compile)
Dockerfiles @ [git.openprivacy.ca/openprivacy/android-go-mobile](https://git.openprivacy.ca/openprivacy/android-go-mobile)
This image was built for use with Drone CI but can be used with any docker setup you want.
Versions are:
- 2024.01
- Go 1.21.5
- Android API 31
- NDK 21.0.6113669
- 2022.11
- Go 1.19.3
- Android API 31