Initial commit

This commit is contained in:
Joe Groocock 2017-05-10 21:55:40 +01:00
commit 164fe8b995
2 changed files with 71 additions and 0 deletions

49
Dockerfile Normal file
View File

@ -0,0 +1,49 @@
FROM busybox:glibc
ARG REPO=http://ftp.de.debian.org/debian/pool/main
ARG ARCH=amd64
ARG LIBC6_VER=2.19-18+deb8u9
ARG LIBGCC_VER=4.9.2-10
ARG LIBSSL_VER=1.0.1t-1+deb8u6
ADD pkgextract /usr/local/bin/
WORKDIR /tmp
RUN mkdir -p /var/lib/dpkg/info && \
# Fetch dependencies
wget ${REPO}/g/glibc/libc6_${LIBC6_VER}_${ARCH}.deb && \
wget ${REPO}/g/glibc/libc6-${ARCH}_${LIBC6_VER}_i386.deb && \
wget ${REPO}/g/glibc/multiarch-support_${LIBC6_VER}_${ARCH}.deb && \
wget ${REPO}/g/gcc-4.9/libgcc1_${LIBGCC_VER}_${ARCH}.deb && \
wget ${REPO}/g/gcc-4.9/gcc-4.9-base_${LIBGCC_VER}_${ARCH}.deb && \
wget ${REPO}/o/openssl/libssl1.0.0_${LIBSSL_VER}_${ARCH}.deb && \
wget ${REPO}/o/openssl/openssl_${LIBSSL_VER}_${ARCH}.deb && \
\
# Lie about libc6 being installed
dpkg-deb -f libc6_*.deb | sed '/Depends: .*/d' > /var/lib/dpkg/status && \
echo "Status: install ok installed" >> /var/lib/dpkg/status && \
\
# Install multiarch && gcc
pkgextract libc6-${ARCH}*.deb && \
pkgextract multiarch-support*.deb && \
pkgextract gcc-4.9-base*.deb && \
pkgextract libgcc1*.deb && \
\
# Lie about libssl being installed to dpkg
dpkg-deb -f libssl1.0*.deb | sed 's|, debconf.*||g' >> /var/lib/dpkg/status && \
echo "Status: install ok installed" >> /var/lib/dpkg/status && \
# Actually 'install' libssl by extracting the files
dpkg-deb -x libssl1.0*.deb / && \
# Manually link the library files
ln -sfv /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib && \
ln -sfv /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib && \
# Install openssl
pkgextract openssl*.deb && \
\
# Cleanup
rm -f *.deb && \
rm -rf /usr/share && \
rm -rf /usr/lib64/gconv # Hopefully this isn't required
WORKDIR /

22
pkgextract Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
FPATH="$(realpath $1)"
FNAME="$(basename "$FPATH")"
PKG_NAME="$(echo "$FNAME" | sed 's|_.*||g')"
# Extract package control files
CTRL_PATH="/tmp/${PKG_NAME}-DEBIAN"
dpkg-deb -e "$FPATH" "$CTRL_PATH"
cd "$CTRL_PATH"
# Rename and move control info files
find * -exec mv "{}" "/var/lib/dpkg/info/$PKG_NAME.{}" \;
cd -
# If this fails, there was probably a
rmdir "$CTRL_PATH"
dpkg -i "$FPATH"