| 1 | ARG BASE_IMAGE |
| 2 | |
| 3 | FROM --platform=linux/amd64 ${BASE_IMAGE} AS build |
| 4 | |
| 5 | COPY scripts/prepare_torch.sh /w/scripts/prepare_torch.sh |
| 6 | COPY scripts/android/build_torch.sh /w/scripts/android/build_torch.sh |
| 7 | ARG UID=10001 |
| 8 | ARG GID=10001 |
| 9 | ARG USER=builder |
| 10 | RUN groupadd -g "$GID" "$USER" && \ |
| 11 | useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER" |
| 12 | |
| 13 | RUN sudo chown $UID:$GID -R /w /root |
| 14 | USER builder |
| 15 | |
| 16 | RUN /w/scripts/android/build_torch.sh && rm -rf /w/scripts/torch_dart/simplybs |
| 17 | |
| 18 | FROM --platform=linux/amd64 alpine |
| 19 | COPY --from=build /w /w |