-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
21 lines (20 loc) · 847 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM golang:latest as builder
RUN mkdir -p /go/src/github.com/ppetko/gopxe
ADD . /go/src/github.com/ppetko/gopxe
WORKDIR /go/src/github.com/ppetko/gopxe
RUN go test ./...
RUN go build -o main .
FROM centos:7.5.1804
RUN yum install -y tftp tftp-server* xinetd* dhcp* epel-release syslinux && yum clean all
EXPOSE 67 67/udp 69/udp 9090 9090/udp
RUN mkdir /var/lib/tftpboot/pxelinux.cfg /opt/localrepo
RUN cp -r /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
ADD ./pxebootImages /var/lib/tftpboot
RUN mkdir -p /gopxe/public ; mkdir /gopxe/ksTempl
WORKDIR /gopxe
COPY --from=builder /go/src/github.com/ppetko/gopxe/main /gopxe/
ADD ./public /gopxe/public
ADD ./ksTempl /gopxe/ksTempl
ADD ./start-gopxe.sh /gopxe/
HEALTHCHECK --interval=4m --timeout=60s CMD curl --fail http://localhost:9090/health || exit 1
ENTRYPOINT ["/gopxe/start-gopxe.sh"]