1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:15 +02:00

add dnsmasq-pxe

This commit is contained in:
kev 2016-06-20 21:33:42 +08:00
parent c5d53aa09f
commit c5ff20a50a
4 changed files with 80 additions and 5 deletions

51
dnsmasq/pxe/README.md Normal file
View File

@ -0,0 +1,51 @@
pxe
===
The Preboot Execution Environment (PXE) is an environment to bootstrap
computers using a network card (i.e Ethernet, Token-Ring) independently of
available data storage devices (like hard disks) or installed operating
systems.
## docker-compose.yml
```yaml
pxe:
image: vimagick/dnsmasq
volumes:
- ./dnsmasq.conf:/etc/dnsmasq.d/dnsmasq.conf
- ./tftpboot:/tftpboot
net: host
restart: always
```
## dnsmasq.conf
```
interface=eth0
port=0
no-hosts
no-resolv
server=8.8.8.8
dhcp-range=192.168.1.10,192.168.1.20,1h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.1
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/tftpboot
```
> You can get all `dhcp-option` codes via `dnsmasq --help dhcp`.
## up and running
```bash
cd ~/fig/pxe/
mkdir tftpboot
wget http://ftp.nl.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/netboot.tar.gz
tar xzf netboot.tar.gz -C tftpboot
docker-compose up -d
docker-compose logs -f
```
> You should stop DHCP service on local network.

11
dnsmasq/pxe/dnsmasq.conf Normal file
View File

@ -0,0 +1,11 @@
interface=eth0
port=0
no-hosts
no-resolv
server=8.8.8.8
dhcp-range=192.168.1.10,192.168.1.20,1h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.1
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/tftpboot

View File

@ -0,0 +1,7 @@
pxe:
image: vimagick/dnsmasq
volumes:
- ./dnsmasq.conf:/etc/dnsmasq.d/dnsmasq.conf
- ./tftpboot:/tftpboot
net: host
restart: always

View File

@ -15,8 +15,8 @@ registry:
- ./certs:/certs
- ./auth:/auth
environment:
- REGISTRY_HTTP_TLS_CERTIFICATE=/certs/easypi.info.crt
- REGISTRY_HTTP_TLS_KEY=/certs/easypi.info.key
- REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.easypi.info.crt
- REGISTRY_HTTP_TLS_KEY=/certs/registry.easypi.info.key
- REGISTRY_AUTH=htpasswd
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
@ -32,11 +32,17 @@ $ docker-compose exec registry bash
>>> exit
$ docker pull alpine
$ docker tag alpine easypi.info:5000/alpine
$ docker tag alpine registry.easypi.info:5000/alpine
$ docker login -u username -p password easypi.info:5000
$ docker push easypi.info:5000/alpine
$ docker pull easypi.info:5000/alpine
$ docker push registry.easypi.info:5000/alpine
$ docker pull registry.easypi.info:5000/alpine
```
## read more
- https://github.com/docker/distribution/blob/master/docs/deploying.md
- https://github.com/docker/distribution/blob/master/docs/insecure.md
- https://serversforhackers.com/tcp-load-balancing-with-nginx-ssl-pass-thru
[1]: https://github.com/docker/distribution