blob: 8018db546df0ba1b81e2ad774d476fb5a7696d7d [file] [log] [blame]
John McGeheeb4b95542018-11-28 16:17:27 -08001# 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 McGehee2232b822018-11-28 17:30:47 -080018#
19# To build and run the container:
20#
21# cd pyfakefs
22# docker build -t pyfakefs .
23# docker run -t pyfakefs
John McGeheeb4b95542018-11-28 16:17:27 -080024
John McGehee2232b822018-11-28 17:30:47 -080025FROM ubuntu
John McGeheeb4b95542018-11-28 16:17:27 -080026MAINTAINER jmcgeheeiv@users.noreply.github.com
27
28# The Ubuntu base container does not specify a locale.
John McGehee2232b822018-11-28 17:30:47 -080029# pyfakefs tests require at least the Latin1 character set.
John McGeheeb4b95542018-11-28 16:17:27 -080030RUN 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
John McGehee7d951a92018-11-28 17:16:58 -080036RUN apt-get update && apt-get install -y \
37 python3-pip \
38 unzip \
39 wget
John McGeheeb4b95542018-11-28 16:17:27 -080040RUN apt-get clean
John McGehee7d951a92018-11-28 17:16:58 -080041
42RUN useradd -u 1000 pyfakefs
43
mrbean-bremen0848f442020-01-04 19:28:26 +010044RUN wget https://github.com/jmcgeheeiv/pyfakefs/archive/master.zip \
45 && unzip master.zip \
46 && chown -R pyfakefs:pyfakefs /pyfakefs-master
47WORKDIR /pyfakefs-master
John McGeheeb4b95542018-11-28 16:17:27 -080048RUN pip3 install -r requirements.txt
49RUN pip3 install -r extra_requirements.txt
50
John McGeheeb4b95542018-11-28 16:17:27 -080051USER pyfakefs
mrbean-bremen0848f442020-01-04 19:28:26 +010052ENV PYTHONPATH /pyfakefs-master
John McGeheeb4b95542018-11-28 16:17:27 -080053CMD ["python3", "-m", "pyfakefs.tests.all_tests"]