Dockerfile.module 781 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Build container;
  2. FROM openfalcon/makegcc-golang:1.15-alpine
  3. LABEL maintainer laiwei.ustc@gmail.com
  4. USER root
  5. ENV FALCON_DIR=/open-falcon PROJ_PATH=${GOPATH}/src/github.com/open-falcon/falcon-plus
  6. RUN mkdir -p $FALCON_DIR && \
  7. apk add --no-cache ca-certificates git
  8. COPY . ${PROJ_PATH}
  9. WORKDIR ${PROJ_PATH}
  10. ARG MODULE
  11. RUN make $MODULE \
  12. && make pack4docker CMD=$MODULE \
  13. && tar -zxf open-falcon-v*.tar.gz -C ${FALCON_DIR} \
  14. && rm -rf ${PROJ_PATH}
  15. # Final container;
  16. FROM alpine:3.13
  17. LABEL maintainer laiwei.ustc@gmail.com
  18. USER root
  19. ENV FALCON_DIR=/open-falcon
  20. RUN mkdir -p $FALCON_DIR/logs && \
  21. apk update && \
  22. apk add --no-cache ca-certificates bash git iproute2
  23. COPY --from=0 ${FALCON_DIR} ${FALCON_DIR}
  24. EXPOSE 8433 8080
  25. WORKDIR ${FALCON_DIR}