diff --git a/dnsmasq/pxe/README.md b/dnsmasq/pxe/README.md index 1789ce8..2d3cadc 100644 --- a/dnsmasq/pxe/README.md +++ b/dnsmasq/pxe/README.md @@ -7,14 +7,24 @@ available data storage devices (like hard disks) or installed operating systems. ## docker-compose.yml + ```yaml pxe: image: vimagick/dnsmasq + net: host volumes: - ./dnsmasq.conf:/etc/dnsmasq.d/dnsmasq.conf - ./tftpboot:/tftpboot - net: host restart: always + +web: + image: nginx:alpine + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf + - ./html:/var/lib/nginx/html + restsart: always ``` ## dnsmasq.conf @@ -35,6 +45,36 @@ tftp-root=/tftpboot > You can get all `dhcp-option` codes via `dnsmasq --help dhcp`. +## nginx.conf + +``` +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + location / { + root html; + index index.html index.htm; + autoindex on; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} +``` + ## up and running ```bash @@ -44,6 +84,10 @@ 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 +mkdir html +wget http://cdimage.debian.org/debian-cd/8.5.0/amd64/iso-cd/debian-8.5.0-amd64-CD-1.iso +mount debian-8.5.0-amd64-CD-1.iso html + docker-compose up -d docker-compose logs -f ``` diff --git a/dnsmasq/pxe/docker-compose.yml b/dnsmasq/pxe/docker-compose.yml index 67741a6..41ada97 100644 --- a/dnsmasq/pxe/docker-compose.yml +++ b/dnsmasq/pxe/docker-compose.yml @@ -1,7 +1,16 @@ pxe: image: vimagick/dnsmasq + net: host volumes: - ./dnsmasq.conf:/etc/dnsmasq.d/dnsmasq.conf - ./tftpboot:/tftpboot - net: host restart: always + +web: + image: nginx:alpine + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf + - ./html:/var/lib/nginx/html + restsart: always diff --git a/dnsmasq/pxe/nginx.conf b/dnsmasq/pxe/nginx.conf new file mode 100644 index 0000000..89f75e8 --- /dev/null +++ b/dnsmasq/pxe/nginx.conf @@ -0,0 +1,25 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + location / { + root html; + index index.html index.htm; + autoindex on; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 3c15e15..11ab409 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -6,7 +6,9 @@ FROM alpine MAINTAINER kev -RUN apk add --no-cache nginx +RUN set -xe \ + && apk add --no-cache nginx \ + && mkdir -p /run/nginx EXPOSE 80 diff --git a/nginx/arm/Dockerfile b/nginx/arm/Dockerfile index eed5cba..6576184 100644 --- a/nginx/arm/Dockerfile +++ b/nginx/arm/Dockerfile @@ -6,7 +6,9 @@ FROM easypi/alpine-arm MAINTAINER EasyPi Software Foundation -RUN apk add --no-cache nginx +RUN set -xe \ + && apk add --no-cache nginx \ + && mkdir -p /run/nginx EXPOSE 80