You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.9 KiB

  1. FROM python:2-alpine3.7 as common
  2. CMD ["/bin/sh"]
  3. RUN apk --no-cache --update add git bash yaml sed lsof findutils
  4. FROM common as builder
  5. RUN apk --update add curl
  6. ## would love to use args... but I need it as an environment variable
  7. ENV KAL_SHLIB_ARRAY_VERSION="0.2.0" \
  8. KAL_SHLIB_CACHE_VERSION="0.0.1" \
  9. KAL_SHLIB_CHARM_VERSION="0.4.0" \
  10. KAL_SHLIB_CMDLINE_VERSION="0.0.4" \
  11. KAL_SHLIB_COMMON_VERSION="0.4.10" \
  12. KAL_SHLIB_CONFIG_VERSION="0.0.2" \
  13. KAL_SHLIB_CORE_VERSION="0.7.0" \
  14. KAL_SHLIB_FIREWALL_VERSION="0.2.0" \
  15. KAL_SHLIB_OTHER_VERSION="0.2.2" \
  16. KAL_SHLIB_PRETTY_VERSION="0.4.3"
  17. ARG DOCKER_CLI_VERSION="17.06.2-ce"
  18. ARG DOCKER_COMPOSE_VERSION="1.21.2"
  19. ## install docker
  20. ENV DOCKER_DOWNLOAD_URL="https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_CLI_VERSION.tgz"
  21. RUN mkdir -p /tmp/docker \
  22. && curl -L "$DOCKER_DOWNLOAD_URL" | tar -xz -C /tmp/docker \
  23. && mv /tmp/docker/docker/docker /usr/local/bin/ \
  24. && rm -rf /tmp/docker
  25. ## install docker-compose
  26. # ENV DOCKER_COMPOSE_DOWNLOAD_URL="https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Linux-x86_64"
  27. # RUN curl -L "$DOCKER_COMPOSE_DOWNLOAD_URL" > /usr/local/bin/docker-compose \
  28. # && chmod +x /usr/local/bin/docker-compose
  29. ## install kal-shlibs
  30. RUN apk --update add binutils && \
  31. mkdir /tmp/kal-shlibs && cd /tmp/kal-shlibs && \
  32. export pkg && \
  33. for pkg in core common array cache charm cmdline config firewall other pretty; do \
  34. echo "Installing kal-shlib-$pkg" ; \
  35. bash -c -- 'eval curl -L http://deb.kalysto.org/pool/no-dist/kal-alpha/kal-shlib-${pkg}_\${KAL_SHLIB_${pkg^^}_VERSION}-1_all.deb' > pkg.deb || exit 1 ; \
  36. ar x pkg.deb || exit 1; \
  37. tar xf /tmp/kal-shlibs/data.tar.* -C / || exit 1; \
  38. rm /tmp/kal-shlibs/data.tar.* ; \
  39. done
  40. ## install shyaml
  41. RUN apk add python-dev build-base
  42. RUN apk add python-dev py-yaml && \
  43. pip install shyaml
  44. RUN pip install docker-compose==$DOCKER_COMPOSE_VERSION
  45. RUN curl -L https://git.0k.io/0k-charm.git/plain/bin/charm > /usr/local/bin/charm && \
  46. chmod +x /usr/local/bin/charm
  47. RUN curl -L https://git.0k.io/git-sub.git/plain/bin/git-sub > /usr/local/bin/git-sub && \
  48. chmod +x /usr/local/bin/git-sub
  49. RUN curl http://docker.0k.io/get/ca.0k.io.pem > /usr/local/share/ca-certificates/ca.0k.io.pem
  50. FROM common
  51. COPY --from=builder /etc/shlib /etc/shlib
  52. COPY --from=builder /usr/lib/shlib /usr/lib/shlib
  53. COPY --from=builder /usr/local /usr/local
  54. RUN cp /usr/local/share/ca-certificates/ca.0k.io.pem /etc/ssl/ca.0k.io.pem && \
  55. apk add ca-certificates && update-ca-certificates && \
  56. mkdir -p /etc/docker/certs.d/docker.0k.io && \
  57. ln -sfn /etc/ssl/ca.0k.io.pem /etc/docker/certs.d/docker.0k.io/ca.crt
  58. ## requiring ``stdbuf`` for actions
  59. RUN apk add coreutils
  60. ## install compose
  61. COPY ./bin/ /usr/local/bin/
  62. ENTRYPOINT ["/usr/local/bin/compose-core"]