1# Copyright 2018 John McGehee. All Rights Reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# Prerequisites: 16# * Install Docker 17# * Clone pyfakefs 18# 19# To build and run the container: 20# 21# cd pyfakefs 22# docker build -t pyfakefs . 23# docker run -t pyfakefs 24 25FROM ubuntu 26MAINTAINER jmcgeheeiv@users.noreply.github.com 27 28# The Ubuntu base container does not specify a locale. 29# pyfakefs tests require at least the Latin1 character set. 30RUN apt-get update && apt-get install -y locales 31RUN locale-gen en_US.UTF-8 32ENV LANG en_US.UTF-8 33ENV LANGUAGE en_US:en 34ENV LC_ALL en_US.UTF-8 35 36RUN apt-get update && apt-get install -y \ 37 python3-pip \ 38 unzip \ 39 wget 40RUN apt-get clean 41 42RUN useradd -u 1000 pyfakefs 43 44RUN wget https://github.com/jmcgeheeiv/pyfakefs/archive/master.zip \ 45 && unzip master.zip \ 46 && chown -R pyfakefs:pyfakefs /pyfakefs-master 47WORKDIR /pyfakefs-master 48RUN pip3 install -r requirements.txt 49RUN pip3 install -r extra_requirements.txt 50 51USER pyfakefs 52ENV PYTHONPATH /pyfakefs-master 53CMD ["python3", "-m", "pyfakefs.tests.all_tests"] 54