progrium/busybox — pull request #9 by dky (2014-10-11 20:29:03+00:00)
Title: Added functions.sh to support opkg-install https://dev.openwrt.org/brows...

Jeff, I had a terrible time trying to get busybox/Dockerfile to run. Everytime I attempted to build it would error out with:

vagrant@dockerbuntu:~/busybox$ docker build .
Sending build context to Docker daemon 11.4 MB
Sending build context to Docker daemon
Step 0 : FROM scratch
---> 511136ea3c5a
Step 1 : MAINTAINER Jeff Lindsay
---> Using cache
---> f7c868d1d092
Step 2 : ADD ./rootfs.tar /
---> Using cache
---> 19fd31a41b13
Step 3 : ADD ./opkg.conf /etc/opkg.conf
---> Using cache
---> b32f6f6626ab
Step 4 : ADD ./opkg-install /usr/bin/opkg-install
---> Using cache
---> 04d9c0b14f20
Step 5 : RUN opkg-cl install http://downloads.openwrt.org/snapshots/trunk/x86_64/packages/base/libgcc_4.8-linaro-1_x86_64.ipk
---> Running in 16cdc12799cf
Downloading http://downloads.openwrt.org/snapshots/trunk/x86_64/packages/base/libgcc_4.8-linaro-1_x86_64.ipk.
Installing libgcc (4.8-linaro-1) to root...
//usr/lib/opkg/info/libgcc.postinst: .: line 3: can't open '/lib/functions.sh'
Configuring libgcc.
Collected errors:
* pkg_run_script: package "libgcc" postinst script returned status 2.
* opkg_configure: libgcc.postinst returned 2.
2014/10/11 17:27:30 The command [/bin/sh -c opkg-cl install http://downloads.openwrt.org/snapshots/trunk/x86_64/packages/base/libgcc_4.8-linaro-1_x86_64.ipk] returned a non-zero code: 255

Turns out functions.sh (https://dev.openwrt.org/browser/trunk/package/base-files/files/lib/functions.sh) was missing, I'm not 100% sure why this file isn't included in opkg or if it's deliberate but using wget and putting into /lib solved the issue for me.

Decided to add the file to the container.

Thanks