Dockerfile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. FROM ubuntu:16.04
  2. RUN apt-get update && apt-get install -yq git vim build-essential dhcping
  3. RUN apt-get update && apt-get install -yq dh-autoreconf automake
  4. RUN apt-get update && apt-get install -yq libssl-dev liblog4cplus-dev libboost-dev libmysqlclient-dev libboost-all-dev mysql-client wget
  5. RUN wget -O kea-1.4.0-P1.tar.gz https://www.isc.org/downloads/file/kea-1-4-0-p1/?version=tar-gz
  6. RUN tar -zxvf kea-1.4.0-P1.tar.gz
  7. RUN mv kea-1.4.0-P1 /opt/kea
  8. # KEA HOOKS
  9. RUN cd /opt/kea && wget -O kea-subscription-1.4.0.tar.gz https://ftp.isc.org/isc/kea/private/f62aefe6b659324b/kea-subscription-1.4.0.tar.gz && tar xvzf kea-subscription-1.4.0.tar.gz
  10. RUN cd /opt/kea && autoreconf --install
  11. RUN cd /opt/kea && ./configure --with-dhcp-mysql --enable-shell
  12. RUN cd /opt/kea && make && make install
  13. RUN cd /opt/kea && ldconfig
  14. EXPOSE 67/udp
  15. EXPOSE 68/udp
  16. ENV KEA_MSG_COMPILER=/usr/local/bin/kea-msg-compiler
  17. ENV KEA_LIB=/opt/kea/src/lib
  18. ENV KEA_INCLUDE=/opt/kea/src/lib
  19. RUN mkdir ~/.ssh
  20. RUN ssh-keyscan -H -p 22 bitbucket.org >> ~/.ssh/known_hosts
  21. COPY keys/ /opt/keys
  22. RUN chmod 0600 /opt/keys/bitbucket.id_rsa
  23. RUN eval $(ssh-agent) && ssh-add /opt/keys/bitbucket.id_rsa && git clone git@bitbucket.org:ikflowdat/kea-cm-hook.git
  24. RUN cd kea-cm-hook && make
  25. RUN git clone git://github.com/alanxz/rabbitmq-c.git
  26. RUN apt-get update && apt-get install -yq cmake
  27. RUN cd rabbitmq-c && mkdir build && cd build && cmake .. && cmake --build .
  28. RUN cd rabbitmq-c/build && make && make install
  29. RUN git clone https://github.com/akalend/amqpcpp
  30. RUN cd amqpcpp && make && make install
  31. RUN cp -P /usr/local/lib/x86_64-linux-gnu/librabbitmq.* /usr/local/lib/
  32. RUN cp amqpcpp/libamqpcpp.a /usr/local/lib/libamqpcpp.a
  33. RUN cp amqpcpp/libamqpcpp.so /usr/local/lib/libamqpcpp.so
  34. RUN ldconfig
  35. COPY hook/ hook/
  36. RUN cd hook/amqp && make
  37. RUN wget -O libzdb-3.1.tar.gz http://www.tildeslash.com/libzdb/dist/libzdb-3.1.tar.gz
  38. RUN tar xvzf libzdb-3.1.tar.gz
  39. RUN cd libzdb-3.1 && ./configure --without-postgresql --without-sqlite && make && make install
  40. RUN apt install -yq python-pip supervisor
  41. RUN pip install superfsmon
  42. COPY script.sh /opt/script.sh
  43. RUN chmod +x /opt/script.sh
  44. CMD /opt/script.sh
  45. HEALTHCHECK --interval=5s --timeout=3s CMD pgrep kea-dhcp4