Create Dockerfile.r4se.3-pack

This commit is contained in:
Jiale Liu 2023-03-19 20:50:01 +08:00 committed by GitHub
parent c7afb8167d
commit ab8e4cffbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

59
Dockerfile.r4se.3-pack Normal file
View File

@ -0,0 +1,59 @@
FROM registry.cn-beijing.aliyuncs.com/licsber/github:r4se.2-rootfs AS rootfs
LABEL maintainer=admin@licsber.site
FROM ubuntu:jammy-20230308 AS pack
ADD --from=rootfs /rootfs.tgz /home/licsber
ENV CPU=rk3399
ENV TARGET_IMAGE_DIRNAME=friendlywrt22.03-docker
ENV TARGET_FRIENDLYWRT_CONFIG=rockchip-docker
ENV TARGET_SD_RAW_FILENAME=R4se-LicsberWrt-22.03-docker.img
# https://github.com/friendlyarm/Actions-FriendlyWrt/blob/master/.github/workflows/build.yml
RUN echo $(nproc) && \
apt update > /dev/null && \
apt install -y -qq wget git clang-13 llvm-13 > /dev/null && \
wget https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh && \
sed -i -e 's/^apt-get -y install openjdk-8-jdk/# apt-get -y install openjdk-8-jdk/g' install.sh && \
sed -i -e 's/^\[ -d fa-toolchain \]/# [ -d fa-toolchain ]/g' install.sh && \
sed -i -e 's/^cat fa-toolchain/# cat fa-toolchain/g' install.sh && \
sed -i -e 's/^tar xf fa-toolchain/# tar xf fa-toolchain/g' install.sh && \
bash install.sh && \
update-alternatives --install $(which python) python /usr/bin/python2.7 20 && \
git clone --depth=1 https://github.com/friendlyarm/repo && \
cp repo/repo /usr/bin/ && \
rm -rf repo/ && \
apt clean && \
rm -rf /var/lib/apt/lists/*
RUN adduser --shell /bin/bash licsber && \
usermod -aG sudo licsber && \
echo 'licsber ALL=(ALL) NOPASSWD:ALL' | tee /etc/sudoers.d/licsber
USER licsber
WORKDIR /home/licsber
RUN repo init --depth=1 -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v22.03 \
-m rk3399.xml --repo-url=https://github.com/friendlyarm/repo --no-clone-bundle && \
repo sync -c kernel --no-clone-bundle && \
repo sync -c u-boot --no-clone-bundle && \
repo sync -c rkbin --no-clone-bundle && \
repo sync -c configs --no-clone-bundle && \
repo sync -c device/common --no-clone-bundle && \
repo sync -c device/friendlyelec --no-clone-bundle && \
repo sync -c scripts --no-clone-bundle && \
repo sync -c scripts/sd-fuse --no-clone-bundle && \
repo sync -c toolchain --no-clone-bundle
RUN echo '. device/friendlyelec/$CPU/base.mk' >> .current_config.mk && \
echo "TARGET_IMAGE_DIRNAME=$TARGET_IMAGE_DIRNAME" >> .current_config.mk && \
echo "TARGET_FRIENDLYWRT_CONFIG=$TARGET_FRIENDLYWRT_CONFIG" >> .current_config.mk && \
echo "TARGET_SD_RAW_FILENAME=$TARGET_SD_RAW_FILENAME" >> .current_config.mk
RUN ./build.sh kernel && \
./build.sh uboot && \
./build.sh sd-img && \
gzip "out/$TARGET_SD_RAW_FILENAME"
FROM alpine
COPY --from=pack "/home/licsber/out/$TARGET_SD_RAW_FILENAME.gz" /