2016-11-10 18:05:03 -05:00
|
|
|
# For running tests, build a docker image with a passwordless sudo and a trust
|
|
|
|
|
# store we can manipulate.
|
|
|
|
|
|
|
|
|
|
FROM centos:6
|
|
|
|
|
|
|
|
|
|
RUN yum install -y epel-release
|
|
|
|
|
|
2017-12-01 13:59:55 -05:00
|
|
|
# Install pip and sudo:
|
2016-11-10 18:05:03 -05:00
|
|
|
RUN yum install -y python-pip sudo
|
2017-12-01 13:59:55 -05:00
|
|
|
# Use pipstrap to update to a stable and tested version of pip
|
|
|
|
|
COPY ./pieces/pipstrap.py /opt
|
|
|
|
|
RUN /opt/pipstrap.py
|
|
|
|
|
# Pin pytest version for increased stability
|
|
|
|
|
RUN pip install pytest==3.2.5
|
2016-11-10 18:05:03 -05:00
|
|
|
|
|
|
|
|
# Add an unprivileged user:
|
|
|
|
|
RUN useradd --create-home --home-dir /home/lea --shell /bin/bash --groups wheel --uid 1000 lea
|
|
|
|
|
|
|
|
|
|
# Let that user sudo:
|
|
|
|
|
RUN sed -i.bkp -e \
|
|
|
|
|
's/# %wheel\(NOPASSWD: ALL\)\?/%wheel/g' \
|
|
|
|
|
/etc/sudoers
|
|
|
|
|
|
|
|
|
|
RUN mkdir -p /home/lea/certbot
|
|
|
|
|
|
|
|
|
|
# Install fake testing CA:
|
|
|
|
|
COPY ./tests/certs/ca/my-root-ca.crt.pem /usr/local/share/ca-certificates/
|
|
|
|
|
RUN update-ca-trust
|
|
|
|
|
|
|
|
|
|
# Copy code:
|
|
|
|
|
COPY . /home/lea/certbot/letsencrypt-auto-source
|
|
|
|
|
|
|
|
|
|
USER lea
|
|
|
|
|
WORKDIR /home/lea
|
|
|
|
|
|
2018-01-08 16:57:04 -05:00
|
|
|
RUN sudo chmod +x certbot/letsencrypt-auto-source/tests/centos6_tests.sh
|
|
|
|
|
CMD sudo certbot/letsencrypt-auto-source/tests/centos6_tests.sh
|