/Dockerfile

https://github.com/jburel/openmicroscopy · Dockerfile · 76 lines · 42 code · 10 blank · 24 comment · 4 complexity · dfb11fe792495df6acaa2c0a438250ce MD5 · raw file

  1. # Development Dockerfile for OMERO
  2. # --------------------------------
  3. # This dockerfile can be used to build an
  4. # OMERO distribution which can then be run
  5. # within a number of different Docker images.
  6. # By default, building this dockerfile will use
  7. # the IMAGE argument below for the runtime image.
  8. ARG BUILD_IMAGE=openjdk:8
  9. # To build code with other runtimes
  10. # pass a build argument, e.g.:
  11. #
  12. # docker build --build-arg BUILD_IMAGE=openjdk:9 ...
  13. #
  14. # The produced /src directory will be copied the
  15. # RUN_IMAGE for end-use. This value can also be
  16. # set at build time with --build-arg RUN_IMAGE=...
  17. ARG COMPONENT=server
  18. ARG RUN_IMAGE=openmicroscopy/omero-${COMPONENT}:latest
  19. FROM ${BUILD_IMAGE} as build
  20. RUN apt-get update \
  21. && apt-get install -y ant \
  22. python-pip python-tables python-virtualenv python-yaml python-jinja2 \
  23. zlib1g-dev python-pillow python-numpy \
  24. libssl-dev libbz2-dev libmcpp-dev libdb++-dev libdb-dev \
  25. zeroc-ice-all-dev \
  26. && pip install --upgrade 'pip<10' setuptools \
  27. && pip install tables "zeroc-ice>3.5,<3.7"
  28. # TODO: unpin pip when possible
  29. RUN adduser omero
  30. # TODO: would be nice to not need to copy .git since it invalidates the build frequently and takes more time
  31. COPY .git /src/.git
  32. COPY build.py /src/
  33. COPY build.xml /src/
  34. COPY components /src/components
  35. COPY docs /src/docs
  36. COPY etc /src/etc
  37. COPY ivy.xml /src/
  38. COPY lib /src/lib
  39. COPY luts /src/luts
  40. COPY omero.class /src/
  41. COPY setup.cfg /src/
  42. COPY sql /src/sql
  43. COPY test.xml /src/
  44. COPY LICENSE.txt /src/
  45. COPY history.rst /src/
  46. RUN chown -R omero /src
  47. USER omero
  48. WORKDIR /src
  49. ENV ICE_CONFIG=/src/etc/ice.config
  50. RUN sed -i "s/^\(omero\.host\s*=\s*\).*\$/\1omero/" /src/etc/ice.config
  51. # The following may be necessary depending on
  52. # which images you are using. See the following
  53. # card for more info:
  54. #
  55. # https://trello.com/c/rPstbt4z/216-open-ssl-110
  56. #
  57. # RUN sed -i 's/\("IceSSL.Ciphers".*ADH[^"]*\)/\1:@SECLEVEL=0/' /src/components/tools/OmeroPy/src/omero/clients.py /src/etc/templates/grid/templates.xml
  58. RUN components/tools/travis-build
  59. FROM ${RUN_IMAGE} as run
  60. COPY --from=build /src /src
  61. USER root
  62. RUN chown -R omero-server:omero-server /src
  63. RUN rm /opt/omero/server/OMERO.server \
  64. && ln -s /src/dist /opt/omero/server/OMERO.server
  65. RUN yum install -y git
  66. USER omero-server