Skip to content

Instantly share code, notes, and snippets.

@haohaolee
Last active July 9, 2022 08:40
Show Gist options
  • Save haohaolee/1a98061e1c846bf02d29ad5b860b5a1d to your computer and use it in GitHub Desktop.
Save haohaolee/1a98061e1c846bf02d29ad5b860b5a1d to your computer and use it in GitHub Desktop.
Static slirp build
# syntax=docker/dockerfile:1.4
# DOCKER_BUILDKIT=1 docker build -t tag .
FROM debian:latest AS build
MAINTAINER haohaolee <hayatelee@gmail.com>
WORKDIR /root
RUN <<eot bash
apt update
apt install -y musl-dev musl-tools cdbs wget dpkg-dev devscripts
wget http://deb.debian.org/debian/pool/main/s/slirp/slirp_1.0.17.orig.tar.gz
wget http://deb.debian.org/debian/pool/main/s/slirp/slirp_1.0.17-11.debian.tar.xz
tar xf slirp_1.0.17.orig.tar.gz
cd slirp-1.0.17
tar xf ../slirp_1.0.17-11.debian.tar.xz
debuild --set-envvar CC="musl-gcc -static -D__P\(x\)=x" -b -uc -us
eot
# Binary is at `slirp-1.0.17/src/slirp-fullbolt`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment