Skip to content

Instantly share code, notes, and snippets.

@yangxuan8282
Last active January 4, 2018 06:13
Show Gist options
  • Save yangxuan8282/42b193074c3a8bd7a08d79065bbb03b3 to your computer and use it in GitHub Desktop.
Save yangxuan8282/42b193074c3a8bd7a08d79065bbb03b3 to your computer and use it in GitHub Desktop.
install debian use pxe, docker
mkdir -p ~/work/run/pxe-debian-install/tftpboot &&
wget http://mirrors.ustc.edu.cn/debian/dists/stretch/main/installer-i386/current/images/netboot/netboot.tar.gz -O - | tar -xz -C ~/work/run/pxe-debian-install/tftpboot
cd ~/work/run/pxe-debian-install &&
docker-compose up

after boot into installer, you should stop the container with:

docker-compose down

otherwise, you target pc can't connect to Internet

interface=eth0
dhcp-range=192.168.1.100,192.168.1.150,255.255.255.0,1h
dhcp-boot=pxelinux.0,pxeserver,192.168.1.101
pxe-service=x86PC, "Install Linux", pxelinux
enable-tftp
tftp-root=/tftpboot
version: "2"
services:
dnsmasq:
image: local/dnsmasq
network_mode: "host"
volumes:
- ./tftpboot:/tftpboot
- ./dnsmasq.conf:/etc/dnsmasq.conf
FROM arm32v6/alpine
RUN apk add --no-cache dnsmasq
EXPOSE 53/tcp \
53/udp \
67/udp
ENTRYPOINT ["dnsmasq", "--no-daemon", "--user=dnsmasq", "--group=dnsmasq"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment