Advertisement
Guest User

satori-com/mzbench:DOCKER

a guest
Dec 7th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. FROM erlang:20.3.2-alpine
  2.  
  3. # install packages
  4. RUN apk update && apk add --no-cache \
  5. bash \
  6. bc \
  7. g++ \
  8. git \
  9. make \
  10. musl-dev \
  11. net-tools \
  12. openssh openssh-server \
  13. openssl \
  14. py2-pip \
  15. rsync \
  16. wget \
  17. zlib-dev \
  18. ;
  19.  
  20. # Add ssl to erlang
  21. RUN apk add --no-cache \
  22. erlang-crypto \
  23. erlang-ssl \
  24. ;
  25.  
  26. # Download kubectl
  27. ARG KUBECTL_VERSION=1.9.6
  28. ARG KUBECTL_CHECKSUM=e6aa618d682d0bcc90602cbf2e22a134d36af7199d7081015042eca02ba36368
  29. RUN wget -O /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
  30. echo "${KUBECTL_CHECKSUM} /usr/bin/kubectl" | sha256sum -c - && \
  31. chmod +x /usr/bin/kubectl
  32.  
  33. WORKDIR /opt/mzbench
  34. COPY . .
  35. # Clean sources just in case you build smth in the same folder
  36. RUN make -C /opt/mzbench/server clean \
  37. && make -C /opt/mzbench/node clean \
  38. && find . -name "*.so" -or -name "*.o" | xargs -I{} rm {}
  39.  
  40. # Compile and configure server
  41. RUN pip install -r requirements.txt \
  42. && make -C /opt/mzbench/server generate \
  43. && mkdir -p /etc/mzbench /root/.ssh \
  44. && echo "[{mzbench_api, [{network_interface, \"0.0.0.0\"},{listen_port, 80}]}]." > /etc/mzbench/server.config \
  45. && ssh-keygen -A \
  46. && cp /etc/ssh/ssh_host_rsa_key /root/.ssh/id_rsa \
  47. && cat /etc/ssh/ssh_host_rsa_key.pub >> /root/.ssh/authorized_keys \
  48. && chmod 0600 /root/.ssh/authorized_keys
  49.  
  50.  
  51. # Compile and install worker into the /root/.local/share
  52. RUN make -C /opt/mzbench/node install
  53.  
  54.  
  55. # env variables can be changed at runtime using `docker run --env ...`
  56. ENV ORIG_PATH=$PATH
  57. ENV CODE_LOADING_MODE=interactive
  58. # config can be added via runtime env
  59. # docker run --env MZBENCH_CONFIG_FILE=<path>
  60. CMD /opt/mzbench/server/_build/default/rel/mzbench_api/bin/mzbench_api foreground
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement