Dockerize tests for easy reproduction.

This commit is contained in:
Arun Allamsetty 2017-10-03 14:04:06 -06:00
parent 365a6d9a02
commit 19a913c108
2 changed files with 48 additions and 0 deletions

9
.dockerignore Normal file
View file

@ -0,0 +1,9 @@
*.swp
.git/
.gitignore
.travis.yml
CHANGELOG.md
Dockerfile
LICENSE
README.md
bash-powerline-screenshot.png

39
Dockerfile Normal file
View file

@ -0,0 +1,39 @@
FROM python:2.7-alpine
MAINTAINER github.com/banga/powerline-shell
ENV USER docker
ENV USERNAME "Docker User"
# Create a 'docker' user because we might not want to run everything as 'root'. Use 9999 as the ID
# to keep it specific and away from the IDs in the host system.
RUN addgroup -g 9999 $USER && \
adduser -u 9999 -G $USER -g "$USERNAME" -s /bin/bash -D $USER
RUN apk add --no-cache --update \
bzr \
fossil \
git \
mercurial \
php5 \
subversion && \
rm -rf /var/cache/apk/*
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Cache the dev requirements.
COPY requirements-dev.txt .
RUN pip install -r requirements-dev.txt
USER docker
RUN bzr whoami "$USERNAME <$USER@example.com>" && \
git config --global user.email "$USER@example.com" && \
git config --global user.name "$USERNAME"
COPY . ./
USER root
RUN chown -R docker:docker .
USER docker
RUN nosetests