A Kubernetes Operator for Zuul
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.

58 lines
2.7KB

  1. FROM quay.io/operator-framework/ansible-operator:v0.13.0
  2. # dhall versions and digests
  3. ARG DHALL_VERSION=1.30.0
  4. ARG DHALL_JSON_VERSION=1.6.2
  5. ARG DHALL_JSON_DIGEST=ea37627c4e19789af33def099d4cb145b874c03b4d5b98cb33ce06be1debf4f3
  6. ARG DHALL_LANG_REF=v14.0.0
  7. ARG DHALL_KUBE_REF=v4.0.0
  8. # kubectl versions and digests
  9. ARG KUBECTL_VERSION=v1.17.0
  10. ARG KUBECTL_DIGEST=a5eb7e2e44d858d96410937a4e4c82f9087c9d120cb2b9e92462878eda59d578
  11. # Install extra requirements
  12. USER root
  13. # See: https://github.com/operator-framework/operator-sdk/issues/2384
  14. # Install gear to connect to the scheduler gearman
  15. RUN pip3 install --upgrade openshift gear
  16. # unarchive: bzip2 and tar
  17. # generate zuul ssh-keys or certificate: openssh and openssl
  18. # manage configuration: git
  19. RUN dnf install -y bzip2 tar openssh openssl git
  20. # Install kubectl to mitigate https://github.com/operator-framework/operator-sdk/issues/2204
  21. RUN curl -OL https://dl.k8s.io/$KUBECTL_VERSION/kubernetes-client-linux-amd64.tar.gz \
  22. && echo "$KUBECTL_DIGEST kubernetes-client-linux-amd64.tar.gz" | sha256sum -c \
  23. && tar -xf kubernetes-client-linux-amd64.tar.gz --strip-components=3 -z --mode='a+x' -C /usr/bin \
  24. && rm kubernetes-client-linux-amd64.tar.gz
  25. # Install dhall-to-json
  26. RUN curl -OL https://github.com/dhall-lang/dhall-haskell/releases/download/$DHALL_VERSION/dhall-json-$DHALL_JSON_VERSION-x86_64-linux.tar.bz2 \
  27. && echo "$DHALL_JSON_DIGEST dhall-json-$DHALL_JSON_VERSION-x86_64-linux.tar.bz2" | sha256sum -c \
  28. && tar -xf dhall-json-$DHALL_JSON_VERSION-x86_64-linux.tar.bz2 --strip-components=2 -j --mode='a+x' -C /usr/bin \
  29. && rm dhall-json-$DHALL_JSON_VERSION-x86_64-linux.tar.bz2
  30. # Back to the default operator user
  31. USER 1001
  32. # Install dhall libraries
  33. RUN git clone --branch $DHALL_LANG_REF --depth 1 https://github.com/dhall-lang/dhall-lang /opt/ansible/dhall-lang \
  34. && git clone --branch $DHALL_KUBE_REF --depth 1 https://github.com/dhall-lang/dhall-kubernetes /opt/ansible/dhall-kubernetes
  35. ENV DHALL_PRELUDE=/opt/ansible/dhall-lang/Prelude/package.dhall
  36. ENV DHALL_KUBERNETES=/opt/ansible/dhall-kubernetes/package.dhall
  37. # Copy configuration
  38. COPY conf/ /opt/ansible/conf/
  39. # Cache dhall objects
  40. RUN echo 'let Prelude = ~/conf/Prelude.dhall let Kubernetes = ~/conf/Kubernetes.dhall in "OK"' | \
  41. env DHALL_PRELUDE=/opt/ansible/dhall-lang/Prelude/package.dhall \
  42. DHALL_KUBERNETES=/opt/ansible/dhall-kubernetes/package.dhall dhall-to-json
  43. # Copy ansible operator requirements
  44. COPY watches.yaml ${HOME}/watches.yaml
  45. COPY roles ${HOME}/roles