-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
46 lines (34 loc) · 1007 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
############################
# STEP 1 build executable binary
############################
FROM golang as builder
WORKDIR $GOPATH/src/aarnaud/ipxeblue/
COPY . .
RUN go mod vendor
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /go/bin/ipxeblue -mod vendor main.go
############################
# STEP 2 build webui
############################
FROM node:16-bullseye as builderui
WORKDIR /webui/
COPY ./webui .
RUN yarn install
RUN yarn build
############################
# STEP 3 ca-certificates
############################
FROM alpine:3 as alpine
RUN apk add -U --no-cache ca-certificates
############################
# STEP 4 build a small image
############################
FROM scratch
ENV GIN_MODE=release
WORKDIR /app/
# Import from builder.
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/bin/ipxeblue /app/ipxeblue
COPY --from=builderui /webui/build /app/admin
COPY templates /app/templates
ENTRYPOINT ["/app/ipxeblue"]
EXPOSE 8080