FROM python@sha256:e48f59cdba69a3cbd9ed2cf0f348d90d45a8d350d98134cf1070bc106ee9ed90 AS base
RUN apt-get update && apt-get install -y --no-install-recommends openssh-client openssh-server nginx sudo && rm -rf /var/lib/apt/lists/* && rm -f /etc/ssh/ssh_host_*
FROM base AS controller
COPY requirements.lock /tmp/requirements.lock
RUN pip install --no-cache-dir --require-hashes -r /tmp/requirements.lock
WORKDIR /work
ENV ANSIBLE_CONFIG=/work/ansible.cfg ANSIBLE_NOCOLOR=1 PYTHONUNBUFFERED=1
ENTRYPOINT ["python", "tools/controller.py"]
FROM base AS target
COPY tools/target.sh /usr/local/bin/aen-target
RUN chmod 755 /usr/local/bin/aen-target
ENTRYPOINT ["/usr/local/bin/aen-target"]
