mirror of
https://github.com/certbot/certbot.git
synced 2026-01-24 19:22:07 +03:00
* We choose a different Travis infra for one of the jobs, as in https://github.com/numpy/numpy/blob/master/.travis.yml#L49. * We keep the language as "python" so the installation of packages (like tox, which we need) doesn't fail. * Override the before_install to disable the dpkg stuff the other jobs need. * adduser is redundant with `--groups sudo` above, so we delete it.
33 lines
863 B
Docker
33 lines
863 B
Docker
# For running tests, build a docker image with a passwordless sudo and a trust
|
|
# store we can manipulate.
|
|
|
|
FROM ubuntu:trusty
|
|
|
|
# Add an unprivileged user:
|
|
RUN useradd --create-home --home-dir /home/lea --shell /bin/bash --groups sudo --uid 1000 lea
|
|
|
|
# Let that user sudo:
|
|
RUN sed -i.bkp -e \
|
|
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
|
|
/etc/sudoers
|
|
|
|
# Install pip and nose:
|
|
RUN apt-get update && \
|
|
apt-get -q -y install python-pip && \
|
|
apt-get clean
|
|
RUN pip install nose
|
|
|
|
RUN mkdir -p /home/lea/letsencrypt/letsencrypt
|
|
|
|
# Install fake testing CA:
|
|
COPY ./tests/certs/ca/my-root-ca.crt.pem /usr/local/share/ca-certificates/
|
|
RUN update-ca-certificates
|
|
|
|
# Copy code:
|
|
COPY . /home/lea/letsencrypt/letsencrypt-auto-source
|
|
|
|
USER lea
|
|
WORKDIR /home/lea
|
|
|
|
CMD ["nosetests", "-v", "-s", "letsencrypt/letsencrypt-auto-source/tests"]
|