John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 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 |
John McGehee | 2232b82 | 2018-11-28 17:30:47 -0800 | [diff] [blame] | 18 | # |
| 19 | # To build and run the container: |
| 20 | # |
| 21 | # cd pyfakefs |
| 22 | # docker build -t pyfakefs . |
| 23 | # docker run -t pyfakefs |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 24 | |
John McGehee | 2232b82 | 2018-11-28 17:30:47 -0800 | [diff] [blame] | 25 | FROM ubuntu |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 26 | MAINTAINER jmcgeheeiv@users.noreply.github.com |
| 27 | |
| 28 | # The Ubuntu base container does not specify a locale. |
John McGehee | 2232b82 | 2018-11-28 17:30:47 -0800 | [diff] [blame] | 29 | # pyfakefs tests require at least the Latin1 character set. |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 30 | RUN apt-get update && apt-get install -y locales |
| 31 | RUN locale-gen en_US.UTF-8 |
| 32 | ENV LANG en_US.UTF-8 |
| 33 | ENV LANGUAGE en_US:en |
| 34 | ENV LC_ALL en_US.UTF-8 |
| 35 | |
John McGehee | 7d951a9 | 2018-11-28 17:16:58 -0800 | [diff] [blame] | 36 | RUN apt-get update && apt-get install -y \ |
| 37 | python3-pip \ |
| 38 | unzip \ |
| 39 | wget |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 40 | RUN apt-get clean |
John McGehee | 7d951a9 | 2018-11-28 17:16:58 -0800 | [diff] [blame] | 41 | |
| 42 | RUN useradd -u 1000 pyfakefs |
| 43 | |
mrbean-bremen | 0848f44 | 2020-01-04 19:28:26 +0100 | [diff] [blame] | 44 | RUN wget https://github.com/jmcgeheeiv/pyfakefs/archive/master.zip \ |
| 45 | && unzip master.zip \ |
| 46 | && chown -R pyfakefs:pyfakefs /pyfakefs-master |
| 47 | WORKDIR /pyfakefs-master |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 48 | RUN pip3 install -r requirements.txt |
| 49 | RUN pip3 install -r extra_requirements.txt |
| 50 | |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 51 | USER pyfakefs |
mrbean-bremen | 0848f44 | 2020-01-04 19:28:26 +0100 | [diff] [blame] | 52 | ENV PYTHONPATH /pyfakefs-master |
John McGehee | b4b9554 | 2018-11-28 16:17:27 -0800 | [diff] [blame] | 53 | CMD ["python3", "-m", "pyfakefs.tests.all_tests"] |