Dockerfile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FROM gearmand/supervisord:1.0
  2. ARG version=1.1.21
  3. LABEL description="Gearman Job Server Image"
  4. LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand"
  5. LABEL version="${version}"
  6. # Install packages
  7. ENV DEBIAN_FRONTEND=noninteractive
  8. RUN apt-get update \
  9. && apt-get -y upgrade \
  10. && apt-get -y install \
  11. make \
  12. gcc \
  13. g++ \
  14. gperf \
  15. libboost-all-dev \
  16. libevent-dev \
  17. libhiredis-dev \
  18. libssl-dev \
  19. libtokyocabinet-dev \
  20. uuid-dev \
  21. wget \
  22. && apt-get clean autoclean \
  23. && apt-get -y autoremove \
  24. && rm -rf /var/lib/apt/lists/*
  25. # Retrieve the source code and untar
  26. WORKDIR /var/lib/gearman
  27. RUN wget https://github.com/gearman/gearmand/releases/download/${version}/gearmand-${version}.tar.gz \
  28. && tar xzvf gearmand-${version}.tar.gz \
  29. && rm -f gearmand-${version}.tar.gz
  30. # Configure, make, install, and clean up
  31. RUN cd gearmand-${version}/ \
  32. && ./configure --prefix=/usr --enable-ssl 2>&1 | tee ../configure.log \
  33. && make 2>&1 | tee ../build.log \
  34. && make test 2>&1 | tee ../test.log \
  35. && make install 2>&1 | tee ../install.log \
  36. && cp -p test-suite.log .. \
  37. && cd .. \
  38. && gzip -9 *.log \
  39. && rm -rf gearmand-${version}*
  40. # Copy SSL certificates
  41. ###COPY gearmand-ca.pem gearmand.pem gearmand.key /var/lib/gearman/
  42. # Configure service
  43. RUN groupadd gearman \
  44. && useradd -r -d /var/lib/gearman -g gearman -G supervisor gearman
  45. RUN touch /var/log/gearmand.log \
  46. && chown gearman:gearman /var/log/gearmand.log
  47. COPY gearmand.conf /etc/supervisor/conf.d/gearmand.conf
  48. HEALTHCHECK --interval=5m --timeout=3s --retries=2 \
  49. CMD test $(supervisorctl status gearmand | awk '{print $2}' | grep 'RUNNING' | wc -l) -eq 1 || exit 1
  50. EXPOSE 4730