Compare commits

...

5 Commits

Author SHA1 Message Date
Dan Ballard 9abe2bcf6d deprecation notice 2024-03-20 00:07:22 -07:00
Dan Ballard 6da170e45a update README with new version 2024-01-02 16:07:02 -08:00
Sarah Jamie Lewis 906e633e4f Merge pull request 'Update 'Dockerfile'' (#5) from sarah-patch-2 into main
Reviewed-on: #5
2024-01-02 23:33:01 +00:00
Sarah Jamie Lewis 0ad842a642 Update 'Dockerfile' 2024-01-02 23:24:04 +00:00
Sarah Jamie Lewis 0efd4ae9a6 Update Go Dependency to 1.19.5
Also move to using fixed binary builds instead of building from source.
2023-01-28 18:53:31 +00:00
2 changed files with 9 additions and 24 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.19.3
ENV GOLANG_SHA256=18ac263e39210bcf68d85f4370e97fb1734166995a1f63fb38b4f6e07d90d212
ENV GOLANG_VERSION=1.21.5.linux-amd64
ENV GOLANG_SHA256=e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e
RUN set -eux; \
apt-get update; \
@ -49,32 +49,11 @@ RUN set -eux; \
golang \
; \
rm -rf /var/lib/apt/lists/*; \
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"; \
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.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,11 +1,17 @@
# 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