-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
80 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
FROM archlinux:base-devel-20220227.0.49015 AS builder | ||
#syntax=docker/dockerfile:1.2 | ||
FROM archlinux:base-devel-20220227.0.49015 AS builder_rust | ||
|
||
COPY install-rust.sh . | ||
RUN ./install-rust.sh | ||
|
||
FROM builder_rust as builder_flutter | ||
|
||
COPY install-deps.sh . | ||
RUN --mount=type=cache,target=/tmp ./install-deps.sh | ||
|
||
RUN ./install-deps.sh | ||
ENV ANDROID_SDK_ROOT /root/Android/sdk | ||
ENV ANDROID_NDK_HOME $ANDROID_SDK_ROOT/android-ndk-r21e | ||
ENV PATH $PATH:$ANDROID_SDK_ROOT/platform-tools:/root/flutter/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
#syntax=docker/dockerfile:1.2 | ||
FROM archlinux:base-devel-20220227.0.49015 AS builder | ||
##syntax=docker/dockerfile:1.2 | ||
#FROM archlinux:base-devel-20220227.0.49015 AS builder_rust | ||
# | ||
#COPY install-rust.sh . | ||
#RUN ./install-rust.sh | ||
# | ||
#FROM builder_rust as builder_flutter | ||
# | ||
#COPY install-deps.sh . | ||
#RUN --mount=type=cache,target=/tmp ./install-deps.sh | ||
# | ||
#ENV ANDROID_SDK_ROOT /root/Android/sdk | ||
#ENV PATH $PATH:$ANDROID_SDK_ROOT/platform-tools:/root/flutter/bin | ||
#ENV ANDROID_NDK_HOME $ANDROID_SDK_ROOT/ndk/21.4.7075529 | ||
|
||
COPY install-deps.sh . | ||
# FROM builder_flutter as builder_zwallet | ||
FROM hhanh00/builder_zwallet as builder | ||
|
||
RUN ./install-deps.sh | ||
|
||
FROM builder as builder2 | ||
|
||
ENV ANDROID_SDK_ROOT /Android/sdk | ||
ENV PATH $PATH:$ANDROID_SDK_ROOT/platform-tools:/flutter/bin | ||
ENV ANDROID_NDK_HOME $ANDROID_SDK_ROOT/ndk/21.4.7075529 | ||
ENV ANDROID_SDK_ROOT /root/Android/sdk | ||
ENV ANDROID_NDK_HOME $ANDROID_SDK_ROOT/android-ndk-r21e | ||
ENV PATH $PATH:$ANDROID_SDK_ROOT/platform-tools:/root/flutter/bin | ||
|
||
COPY . /zwallet | ||
|
||
RUN git config --global --add safe.directory /flutter | ||
RUN git config --global --add safe.directory /root/flutter | ||
RUN --mount=type=secret,id=pwd cd /zwallet && ./configure.sh zcash && ./build.sh | ||
|
||
FROM alpine:latest | ||
WORKDIR /root | ||
COPY --from=builder2 /zwallet/build/app/outputs/bundle/release/* ./ | ||
COPY --from=builder /zwallet/build/app/outputs/bundle/release/* ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
#!/bin/sh | ||
|
||
ROOT_DIR=$1 | ||
if [ "$ROOT_DIR" == "" ]; then | ||
ROOT_DIR="/root" | ||
fi | ||
|
||
pacman -Sy --noconfirm unzip jdk8-openjdk wget | ||
|
||
wget -P /tmp -N https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip | ||
wget -P /tmp -N https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip | ||
wget -P /tmp -N https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.0.1-stable.tar.xz | ||
|
||
wget -P /tmp -N https://download.z.cash/downloads/sapling-output.params | ||
wget -P /tmp -N https://download.z.cash/downloads/sapling-spend.params | ||
|
||
mkdir -p $ROOT_DIR/Android/sdk | ||
export ANDROID_SDK_ROOT=$ROOT_DIR/Android/sdk | ||
pacman -Sy --noconfirm unzip jdk8-openjdk git cmake | ||
|
||
curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip | ||
unzip sdk-tools.zip | ||
(cd cmdline-tools/bin && | ||
(cd $ROOT_DIR;unzip -o /tmp/commandlinetools-linux-7583922_latest.zip; | ||
cd cmdline-tools/bin && | ||
yes | ./sdkmanager --sdk_root=$ANDROID_SDK_ROOT --licenses && | ||
yes | ./sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools" "platforms;android-31" && | ||
yes | ./sdkmanager --sdk_root=$ANDROID_SDK_ROOT "ndk;21.4.7075529") | ||
rm sdk-tools.zip | ||
|
||
pacman -Sy --noconfirm rustup | ||
rustup install stable | ||
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android | ||
cargo install --force cargo-make | ||
yes | ./sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools" "platforms;android-31") | ||
|
||
curl -o flutter.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.0.0-stable.tar.xz | ||
tar xvf flutter.tar.xz | ||
rm -f flutter.tar.xz | ||
(cd $ANDROID_SDK_ROOT;unzip -o /tmp/android-ndk-r21e-linux-x86_64.zip) | ||
(cd $ROOT_DIR;tar xvf /tmp/flutter_linux_3.0.1-stable.tar.xz) | ||
|
||
mkdir $HOME/.zcash-params | ||
curl https://download.z.cash/downloads/sapling-output.params -o $HOME/.zcash-params/sapling-output.params | ||
curl https://download.z.cash/downloads/sapling-spend.params -o $HOME/.zcash-params/sapling-spend.params | ||
mkdir -p $HOME/.zcash-params | ||
cp /tmp/sapling-output.params /tmp/sapling-spend.params $HOME/.zcash-params | ||
|
||
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21.4.7075529 | ||
export PATH=$PATH:/flutter/bin | ||
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/android-ndk-r21e | ||
export PATH=$PATH:$ROOT_DIR/flutter/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
pacman -Sy --noconfirm git cmake rustup | ||
rustup install stable | ||
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android | ||
cargo install --force cargo-make cargo-ndk |