Skip to content

Commit

Permalink
Merge pull request #348 from ktock/busybox-source
Browse files Browse the repository at this point in the history
Dockerfile: busybox: use source tarball
  • Loading branch information
ktock authored Nov 11, 2024
2 parents 0247343 + dd374d6 commit eb4e3ac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
26 changes: 16 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG WIZER_VERSION=04e49c989542f2bf3a112d60fbf88a62cce2d0d0
ARG EMSDK_VERSION=3.1.40 # TODO: support recent version
ARG EMSDK_VERSION_QEMU=3.1.50 # TODO: support recent version
ARG BINARYEN_VERSION=114
ARG BUSYBOX_VERSION=1_36_1
ARG BUSYBOX_VERSION=1.36.1
ARG RUNC_VERSION=v1.2.0-rc.2

# ARG LINUX_LOGLEVEL=0
Expand Down Expand Up @@ -216,10 +216,12 @@ FROM binfmt-$TARGETARCH AS binfmt-dev

FROM gcc-riscv64-linux-gnu-base AS busybox-riscv64-dev
ARG BUSYBOX_VERSION
RUN apt-get update -y && apt-get install -y gcc bzip2
RUN apt-get update -y && apt-get install -y gcc bzip2 wget
WORKDIR /work
RUN git clone -b $BUSYBOX_VERSION --depth 1 https://git.busybox.net/busybox
WORKDIR /work/busybox
RUN wget https://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
RUN bzip2 -d busybox-${BUSYBOX_VERSION}.tar.bz2
RUN tar xvf busybox-${BUSYBOX_VERSION}.tar
WORKDIR /work/busybox-${BUSYBOX_VERSION}
RUN make CROSS_COMPILE=riscv64-linux-gnu- LDFLAGS=--static defconfig
RUN make CROSS_COMPILE=riscv64-linux-gnu- LDFLAGS=--static -j$(nproc)
RUN mkdir -p /out/bin && mv busybox /out/bin/busybox
Expand Down Expand Up @@ -502,10 +504,12 @@ COPY --link --from=linux-amd64-config-dev /work-buildlinux/linux/.config /

FROM gcc-x86-64-linux-gnu-base AS busybox-amd64-dev
ARG BUSYBOX_VERSION
RUN apt-get update -y && apt-get install -y gcc bzip2
RUN apt-get update -y && apt-get install -y gcc bzip2 wget
WORKDIR /work
RUN git clone -b $BUSYBOX_VERSION --depth 1 https://git.busybox.net/busybox
WORKDIR /work/busybox
RUN wget https://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
RUN bzip2 -d busybox-${BUSYBOX_VERSION}.tar.bz2
RUN tar xvf busybox-${BUSYBOX_VERSION}.tar
WORKDIR /work/busybox-${BUSYBOX_VERSION}
RUN make CROSS_COMPILE=x86_64-linux-gnu- LDFLAGS=--static defconfig
RUN make CROSS_COMPILE=x86_64-linux-gnu- LDFLAGS=--static -j$(nproc)
RUN mkdir -p /out/bin && mv busybox /out/bin/busybox
Expand Down Expand Up @@ -624,10 +628,12 @@ COPY --link --from=linux-aarch64-config-dev /work-buildlinux/linux/.config /

FROM gcc-aarch64-linux-gnu-base AS busybox-aarch64-dev
ARG BUSYBOX_VERSION
RUN apt-get update -y && apt-get install -y gcc bzip2
RUN apt-get update -y && apt-get install -y gcc bzip2 wget
WORKDIR /work
RUN git clone -b $BUSYBOX_VERSION --depth 1 https://git.busybox.net/busybox
WORKDIR /work/busybox
RUN wget https://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
RUN bzip2 -d busybox-${BUSYBOX_VERSION}.tar.bz2
RUN tar xvf busybox-${BUSYBOX_VERSION}.tar
WORKDIR /work/busybox-${BUSYBOX_VERSION}
RUN make CROSS_COMPILE=aarch64-linux-gnu- LDFLAGS=--static defconfig
RUN make CROSS_COMPILE=aarch64-linux-gnu- LDFLAGS=--static -j$(nproc)
RUN mkdir -p /out/bin && mv busybox /out/bin/busybox
Expand Down
10 changes: 6 additions & 4 deletions examples/raspi3ap-qemu/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
ARG BUSYBOX_VERSION=1_36_1
ARG BUSYBOX_VERSION=1.36.1
ARG KERNEL_TAG=1.20230405

FROM ubuntu:22.04 AS rootfs-dev
RUN apt-get update && apt-get install -y gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross git make
ARG BUSYBOX_VERSION
RUN apt-get update -y && apt-get install -y gcc bzip2
RUN apt-get update -y && apt-get install -y gcc bzip2 wget
WORKDIR /work
RUN git clone -b $BUSYBOX_VERSION --depth 1 https://git.busybox.net/busybox
WORKDIR /work/busybox
RUN wget https://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
RUN bzip2 -d busybox-${BUSYBOX_VERSION}.tar.bz2
RUN tar xvf busybox-${BUSYBOX_VERSION}.tar
WORKDIR /work/busybox-${BUSYBOX_VERSION}
RUN make CROSS_COMPILE=aarch64-linux-gnu- LDFLAGS=--static defconfig
RUN make CROSS_COMPILE=aarch64-linux-gnu- LDFLAGS=--static -j$(nproc)
RUN mkdir -p /rootfs/bin && mv busybox /rootfs/bin/busybox
Expand Down

0 comments on commit eb4e3ac

Please sign in to comment.