Files
zuul/playbooks/zuul-stream/fixtures/Dockerfile.py27
Ian Wienand 34543b8ac5 zuul-stream : Test against a Python 2.7 container
Change Ief366c092e05fb88351782f6d9cd280bfae96237 intoduced a bug in
the streaming daemons because it was using Python 3.6 features.  The
streaming console needs to work on all Ansible managed nodes, which
includes back to Python 2.7 nodes (while Ansible supports that).

This introduces a regression test by building about the smallest
Python 2.7 container that can be managed by Ansbile.  We start this
container and modify the test inventory to include it, then run the
stream tests against it.

The existing testing runs against the "new" console but also tests
against the console OpenDev's Zuul starts to ensure
backwards-compatability.  Since this container wasn't started by Zuul
it doesn't have this, so that testing is skipped for this node.

It might be good to abstract all testing of the console daemons into
separate containers for each Ansible supported managed-node Python
version -- it's a bit more work than I want to take on right now.
This should ensure the lower-bound though and prevent regressions for
older platforms.

Change-Id: Ia78ad9e3ec51bc47bf68c9ff38c0fcd16ba2e728
2022-09-07 10:48:25 +10:00

25 lines
784 B
Docker

FROM python:2.7.18-buster AS buster-2.7-ssh
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y dumb-init openssh-server \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd && chmod 0755 /var/run/sshd
# This may or not be required to allow logins by preventing pam_loginuid
# trying to write out audit level things that may not work in a container
RUN sed -ri 's/session(\s+)required(\s+)pam_loginuid.so/session\1optional\2pam_loginuid.so/' /etc/pam.d/sshd
RUN ssh-keygen -A -v
RUN ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519
COPY authorized_keys /root/.ssh/authorized_keys
RUN chmod 0600 /root/.ssh/authorized_keys
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0" ]