Giter Site home page Giter Site logo

Comments (3)

yosifkit avatar yosifkit commented on May 31, 2024

For all our arches we just use the build script:

docker run --rm "$base$version-builder" tar cC rootfs . | xz -z9 > "$version/busybox.tar.xz"

Which takes advantage of the work done in the Dockerfile.builder to setup the contents for the tar:

RUN set -ex \
&& make -j "$(nproc)" \
busybox \
&& ./busybox --help \
&& mkdir -p rootfs/bin \
&& ln -vL busybox rootfs/bin/ \
\
&& ln -vL "$(which getconf)" rootfs/bin/getconf \
\
# hack hack hack hack hack
# with glibc, static busybox uses libnss for DNS resolution :(
&& mkdir -p rootfs/etc \
&& cp /etc/nsswitch.conf rootfs/etc/ \
&& mkdir -p rootfs/lib \
&& ln -sT lib rootfs/lib64 \
&& set -- \
rootfs/bin/busybox \
rootfs/bin/getconf \
/lib/"$(gcc -print-multiarch)"/libnss*.so.* \
# libpthread is part of glibc: http://stackoverflow.com/a/11210463/433558
/lib/"$(gcc -print-multiarch)"/libpthread*.so.* \
&& while [ "$#" -gt 0 ]; do \
f="$1"; shift; \
fn="$(basename "$f")"; \
if [ -e "rootfs/lib/$fn" ]; then continue; fi; \
if [ "${f#rootfs/}" = "$f" ]; then \
if [ "${fn#ld-}" = "$fn" ]; then \
ln -vL "$f" "rootfs/lib/$fn"; \
else \
cp -v "$f" "rootfs/lib/$fn"; \
fi; \
fi; \
set -- "$@" $(ldd "$f" | awk ' \
$1 ~ /^\// { print $1; next } \
$2 == "=>" && $3 ~ /^\// { print $3; next } \
'); \
done \
\
&& chroot rootfs /bin/getconf _NPROCESSORS_ONLN \
\
&& chroot rootfs /bin/busybox --install /bin
RUN set -ex; \
buildrootVersion='2017.02.2'; \
mkdir -p rootfs/etc; \
for f in passwd shadow group; do \
curl -fL -o "rootfs/etc/$f" "https://git.busybox.net/buildroot/plain/system/skeleton/etc/$f?id=$buildrootVersion"; \
done
# create /tmp
RUN mkdir -p rootfs/tmp \
&& chmod 1777 rootfs/tmp
# create missing home directories
RUN set -ex \
&& cd rootfs \
&& for userHome in $(awk -F ':' '{ print $3 ":" $4 "=" $6 }' etc/passwd); do \
user="${userHome%%=*}"; \
home="${userHome#*=}"; \
home="./${home#/}"; \
if [ ! -d "$home" ]; then \
mkdir -p "$home"; \
chown "$user" "$home"; \
fi; \
done

from busybox.

jcxian avatar jcxian commented on May 31, 2024

I found "FROM debian:stretch-slim" from Dockerfile.builder. there's no debian:stretch-slim for mips64le architecture. how can i do for it?

from busybox.

tianon avatar tianon commented on May 31, 2024

Just to thread the needle, see debuerreotype/docker-debian-artifacts#23 (issue filed with the same question following this one).

from busybox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.