Initial BusyBox-upstream-based tarmaker

This commit is contained in:
Tianon Gravi 2015-02-02 23:02:09 -07:00
commit ca6bcbfa93
3 changed files with 45 additions and 0 deletions

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM scratch
ADD busybox.tar /bin
CMD ["sh"]

33
builder/Dockerfile Normal file
View File

@ -0,0 +1,33 @@
FROM debian:jessie
RUN apt-get update && apt-get install -y \
bzip2 \
curl \
gcc \
make \
&& rm -rf /var/lib/apt/lists/*
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys C9E9416F76E610DBD09D040F47B70C55ACC9965B
WORKDIR /usr/src/busybox
ENV BUSYBOX_VERSION 1.23.1
RUN set -x \
&& curl -sSL "http://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2" -o busybox.tar.bz2 \
&& curl -sSL "http://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2.sign" -o busybox.tar.bz2.sign \
&& gpg --verify busybox.tar.bz2.sign \
&& tar -xf busybox.tar.bz2 --strip-components 1 \
&& rm busybox.tar.bz2*
RUN set -x \
&& make defconfig \
&& echo 'CONFIG_STATIC=y' >> .config
RUN set -x \
&& make -j$(nproc) \
&& mkdir -p rootfs-bin \
&& ln busybox rootfs-bin/ \
&& rootfs-bin/busybox --install rootfs-bin
CMD ["./busybox"]

9
make.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
cd "$(readlink -f "$(dirname "$BASH_SOURCE")")"
set -x
docker build -t busybox:builder builder
docker run --rm busybox:builder tar cC rootfs-bin . > busybox.tar
docker build -t busybox .