-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (26 loc) · 1021 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
FROM golang:alpine as builder
RUN apk add --no-cache make git
RUN git clone https://github.com/micromdm/micromdm.git /go/src/github.com/micromdm/micromdm
WORKDIR /go/src/github.com/micromdm/micromdm/
ENV CGO_ENABLED=0 \
GOARCH=amd64 \
GOOS=linux
RUN make deps
RUN make
FROM alpine
ENV MICROMDM_CONFIG_DIR="/data/config"
ENV MICROMDM_CERTS_DIR="/data/certs"
ENV MICROMDM_REPO_DIR="/data/repo"
VOLUME "/data"
COPY docker-entrypoint.d /docker-entrypoint.d
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN apk --update add ca-certificates
COPY --from=builder /go/src/github.com/micromdm/micromdm/build/linux/micromdm /usr/local/bin/
COPY --from=builder /go/src/github.com/micromdm/micromdm/build/linux/mdmctl /usr/local/bin/
RUN chmod a+x /usr/local/bin/micromdm
RUN chmod a+x /usr/local/bin/mdmctl
RUN mkdir -p ${MICROMDM_CONFIG_DIR} ${MICROMDM_CERTS_DIR} ${MICROMDM_REPO_DIR}
RUN chmod +x /docker-entrypoint.d/*.sh
RUN chmod a+x /docker-entrypoint.sh
EXPOSE 80 443 8080
ENTRYPOINT ["/docker-entrypoint.sh"]