Compare commits

...

10 Commits

Author SHA1 Message Date
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: openprivacy/android-go-mobile#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
Sarah Jamie Lewis 6280a51b6e Update 'Dockerfile' 2023-01-25 23:31:02 +00:00
Dan Ballard 423e81de7d 2022.11 fixes 2022-11-30 11:40:17 -08:00
Sarah Jamie Lewis 224ce2663d Update Go Dependency to 1.19.3 2022-11-30 17:31:15 +00:00
Dan Ballard b55c0713cb update home 2021-11-16 18:15:38 -08:00
Dan Ballard 43db611a50 update README md syntax 2021-03-23 11:51:00 -07:00
Dan Ballard 7997f18a4e README typo go version 2021-03-23 11:33:36 -07:00
2 changed files with 28 additions and 33 deletions

View File

@ -6,7 +6,7 @@ FROM openjdk:8
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip" \ ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip" \
ANDROID_HOME="/usr/local/android-sdk" \ ANDROID_HOME="/usr/local/android-sdk" \
ANDROID_SDK=$ANDROID_HOME \ ANDROID_SDK=$ANDROID_HOME \
ANDROID_VERSION=29 \ ANDROID_VERSION=31 \
ANDROID_BUILD_TOOLS_VERSION=30.0.2 ANDROID_BUILD_TOOLS_VERSION=30.0.2
## Download Android SDK ## Download Android SDK
@ -24,7 +24,7 @@ RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSIO
"platform-tools" "platform-tools"
# Install NDK # Install NDK
ENV NDK_VER="21.0.6113669" ENV NDK_VER="22.1.7171670"
RUN $ANDROID_HOME/tools/bin/sdkmanager "ndk;$NDK_VER" RUN $ANDROID_HOME/tools/bin/sdkmanager "ndk;$NDK_VER"
RUN ln -sf $ANDROID_HOME/ndk/$NDK_VER $ANDROID_HOME/ndk-bundle RUN ln -sf $ANDROID_HOME/ndk/$NDK_VER $ANDROID_HOME/ndk-bundle
@ -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 ## - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN echo 'hosts: files dns' > /etc/nsswitch.conf RUN echo 'hosts: files dns' > /etc/nsswitch.conf
ENV GOLANG_VERSION=1.15.10 ENV GOLANG_VERSION=1.21.5.linux-amd64
ENV GOLANG_SHA256=c1dbca6e0910b41d61a95bf9878f6d6e93d15d884c226b91d9d4b1113c10dd65 ENV GOLANG_SHA256=e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e
RUN set -eux; \ RUN set -eux; \
apt-get update; \ apt-get update; \
@ -49,32 +49,11 @@ RUN set -eux; \
golang \ golang \
; \ ; \
rm -rf /var/lib/apt/lists/*; \ rm -rf /var/lib/apt/lists/*; \
export \ wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.tar.gz"; \
## 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 -; \ echo "$GOLANG_SHA256 *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \ tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \ rm go.tgz; \
\ \
cd /usr/local/go/src; \
./make.bash; \
\
export PATH="/usr/local/go/bin:$PATH"; \ export PATH="/usr/local/go/bin:$PATH"; \
go version go version
@ -89,16 +68,18 @@ ENV GOPATH=$GOMOBILEPATH
ENV PATH=$GOMOBILEPATH/bin:$PATH ENV PATH=$GOMOBILEPATH/bin:$PATH
RUN mkdir -p "$GOMOBILEPATH/src" "$GOMOBILEPATH/bin" "$GOMOBILEPATH/pkg" && chmod -R 777 "$GOMOBILEPATH" RUN mkdir -p "$GOMOBILEPATH/src" "$GOMOBILEPATH/bin" "$GOMOBILEPATH/pkg" && chmod -R 777 "$GOMOBILEPATH"
# 2022.11.09
ENV GOMOBILEHASH=43a0384520996c8376bfb8637390f12b44773e65
# install gomobile # install gomobile
RUN cd $GOMOBILEPATH/src; \ RUN cd $GOMOBILEPATH/src; \
mkdir -p golang.org/x; \ mkdir -p golang.org/x; \
cd golang.org/x; \ cd golang.org/x; \
git clone https://github.com/golang/mobile.git; \ git clone https://github.com/golang/mobile.git; \
cd mobile; \ cd mobile; \
git checkout bdb1ca9a1e083af5929a8214e8a056d638ebbf2d; git checkout $GOMOBILEHASH;
RUN go get golang.org/x/mobile/cmd/gomobile RUN go install golang.org/x/mobile/cmd/gomobile@$GOMOBILEHASH
RUN go get golang.org/x/mobile/cmd/gobind RUN go install golang.org/x/mobile/cmd/gobind@$GOMOBILEHASH
RUN go get golang.org/x/mobile/bind
RUN gomobile clean RUN gomobile clean

View File

@ -1,9 +1,23 @@
# Android, Go, and gomobile # Android, Go, and gomobile
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. This image was built for use with Drone CI but can be used with any docker setup you want.
Versions are: Versions are:
- 2024.01
- Go 1.21.5
- Android API 31
- NDK 21.0.6113669
- 2022.11
- Go 1.19.3
- Android API 31
- NDK 21.0.6113669
- 2021.03
- Go 1.17.5
- Android API 30
- NDK 21.0.6113669
- 2021.03 - 2021.03
- Go 1.15.10 - Go 1.15.10
- Android API 29 - Android API 29
@ -20,7 +34,7 @@ Versions are:
This image includes: This image includes:
- Android SDK, NDK, tools, and API version 29 and Buildtools 30.0.2 at `/usr/local/android-sdk` - Android SDK, NDK, tools, and API version 29 and Buildtools 30.0.2 at `/usr/local/android-sdk`
- Go lang 1.10.3 at `/usr/local/go` - Go lang 1.15.10 at `/usr/local/go`
- $GOPATH set to `/gomobile` - $GOPATH set to `/gomobile`
- GOPATH includes gomobile cmd tools and source - GOPATH includes gomobile cmd tools and source
@ -30,8 +44,8 @@ This container has its own GOPATH with only gomobile in it, so to use, you'll ne
image: openpriv/android-go-mobile:2021.03 image: openpriv/android-go-mobile:2021.03
commands: commands:
- go mod download - go mod download
- gomobile init - gomobile init
- make - make
### Version 2018.07 ### Version 2018.07