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 15FROM ubuntu 16MAINTAINER jmcgeheeiv@users.noreply.github.com 17 18RUN apt-get update && apt-get install -y locales 19RUN locale-gen en_US.UTF-8 20ENV LANG en_US.UTF-8 21ENV LANGUAGE en_US:en 22ENV LC_ALL en_US.UTF-8 23ARG github_repo=pytest-dev/pyfakefs 24ARG github_branch=main 25 26RUN apt-get update && apt-get install -y \ 27 python3-pip \ 28 unzip \ 29 wget \ 30 python3-venv 31 32RUN apt-get clean 33 34RUN useradd pyfakefs 35 36RUN mkdir -p work \ 37 && wget https://github.com/$github_repo/archive/$github_branch.zip -O archive.zip \ 38 && unzip archive.zip -d work 39RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs 40RUN chown -R pyfakefs:pyfakefs work/pyfakefs 41WORKDIR work/pyfakefs 42RUN python3 -m venv ../venv 43RUN ../venv/bin/pip install -r requirements.txt 44RUN ../venv/bin/pip install -r extra_requirements.txt 45 46USER pyfakefs 47ENV PYTHONPATH work/pyfakefs 48ENV TEST_REAL_FS=1 49CMD ["../venv/bin/python", "-m", "pyfakefs.tests.all_tests"] 50