Skip to content

Instantly share code, notes, and snippets.

@djbender
Last active April 25, 2020 14:16
Show Gist options
  • Save djbender/25de9775ffc6058cab251573bc1c4da8 to your computer and use it in GitHub Desktop.
Save djbender/25de9775ffc6058cab251573bc1c4da8 to your computer and use it in GitHub Desktop.
install pigz on boot2docker tiny core linux environments (i.e. dinghy) for speedup on docker image layer extraction

connect to the boot2docker image via dinghy ssh

# /var/lib/boot2docker/install-pigz.sh
#!/bin/bash
set -o errexit -o errtrace -o pipefail -o xtrace
PIGZ_VERSION=2.4
LINUX_HEADERS_VERSION=4.19
su - docker -c " \
\
cd /tmp \
&& if [ ! -f pigz.tar.gz ]; then curl -o pigz.tar.gz https://www.zlib.net/pigz/pigz-${PIGZ_VERSION}.tar.gz; fi \
&& echo 'https://distro.ibiblio.org/tinycorelinux' > /opt/tcemirror \
&& tce-load -wi zlib_base-dev glibc_base-dev glibc_add_lib make gcc linux-${LINUX_HEADERS_VERSION}_api_headers \
&& tar zvxf /var/lib/boot2docker/pigz.tar.gz && cd pigz-${PIGZ_VERSION} && make clean && make \
"
cp pigz /usr/local/bin && cp unpigz /usr/local/bin
# /var/lib/boot2docker/profile
# <boot2docker env variables omitted for brevity>
./install-pigz.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment