FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.10

ENV PKGS_LIST=packages-list.ocp
ARG EXTRA_PKGS_LIST
ARG PATCH_LIST

COPY ${PKGS_LIST}* ${EXTRA_PKGS_LIST:-$PKGS_LIST} ${PATCH_LIST:-$PKGS_LIST} /tmp/
COPY prepare-image.sh patch-image.sh /bin/

RUN prepare-image.sh && \
  mkdir -p /etc/ironic-python-agent && \
  rm -f /bin/prepare-image.sh

COPY hardware_manager /tmp/hardware_manager

RUN PBR_VERSION=1.0 pip3 install --no-index --verbose --prefix=/usr /tmp/hardware_manager

COPY ironic-python-agent.conf /etc/ironic-python-agent/00-defaults.conf

ENTRYPOINT ["ironic-python-agent", "--config-dir", "/etc/ironic-python-agent"]
