AcoSailV2CrossArm64/Dockerfile

49 lines
1.8 KiB
Docker

FROM debian:bullseye-slim
# Update apt source
#RUN echo "deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free" > /etc/apt/source.list
RUN rm -rf /etc/apt/sources.list.d
RUN echo "deb [trusted=yes] http://mirrors.huaweicloud.com/debian/ bullseye main contrib non-free" > /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y gpg gpg-agent ca-certificates
RUN apt-get update && \
apt-get install -y bzip2 crossbuild-essential-arm64 vim binfmt-support
RUN echo "deb [trusted=yes] https://repo.acosail.com/acosail/V2_repo/ acosail main non-free" > /etc/apt/sources.list
ADD ./hkdshen_acoinfo.asc /
RUN apt-key add /hkdshen_acoinfo.asc
RUN apt-get update
# Update apt and get crossbuild ENV for arm64;
# Set ENV for crossbuild arm64 app;
ENV CC=aarch64-linux-gnu-gcc
ENV CXX=aarch64-linux-gnu-g++
# Make dir for sources' dir in host machine;
RUN mkdir /app
WORKDIR /app
# Add ARM64 base rootfs into Docker;
ADD ./rootfs_docker_base.txz /rootfs
ADD ./hkdshen_acoinfo.asc /rootfs
# Make sure we can qemu arm64 inside Docker;
RUN mkdir /rootfs/app
COPY ./qemu-aarch64-static /usr/bin/qemu-aarch64-static
COPY ./qemu-aarch64-static /rootfs/bin/qemu-aarch64-static
# Add some tools to make rootfs useble;
RUN chroot /rootfs sh -c "echo 'deb [trusted=yes] http://mirrors.huaweicloud.com/debian/ bullseye main contrib non-free' > /etc/apt/sources.list"
RUN chroot /rootfs sh -c "apt-get update && apt-get install -y gpg gpg-agent ca-certificates"
RUN chroot /rootfs sh -c "apt install -y build-essential libncurses5-dev llvm-dev clang cmake bash"
RUN chroot /rootfs sh -c "echo 'deb [trusted=yes] https://repo.acosail.com/acosail/V2_repo/ acosail main non-free' > /etc/apt/sources.list"
RUN chroot /rootfs sh -c "apt-key add /hkdshen_acoinfo.asc"
ADD bashrc /root/.bashrc
# Now we are in AcoSail V2 cross build ENV for arm64.
CMD ["/bin/bash"]