File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ *
Original file line number Diff line number Diff line change 1+ # Dockerfile to build python 2 environment
2+ #
3+ # This dockerfile can be used to build the same python2 environment that we
4+ # use for testing and development. To build the docker container, run the
5+ # following commands.
6+ #
7+ # cd devtools/dockerfiles
8+ # docker build -f Dockerfile.python2 -t python2 .
9+ #
10+ # The docker container can then be used as any other docker containter would
11+ # be used. Connecting to your BIG-IP inside of Vagrant may require that you
12+ # add a forwarded host in Docker to the Vagrant machine itself.
13+ #
14+ # For example,
15+ #
16+ # docker run -it --add-host="localhost:192.168.1.1" \
17+ # -v "${HOME}/src/trupp/f5-common-python:/artifacts" python2
18+ #
19+ # The 192.x address in this case is the IP address of vboxnet0 interfaces on
20+ # your host machine (the one that runs docker and vagrant)
21+
22+ FROM python:2
23+ MAINTAINER @f5networks
24+
25+ RUN mkdir -p /artifacts/coverage
26+ WORKDIR /artifacts
27+
28+ RUN apt-get update && apt-get -y install vim
29+
30+ RUN pip install hacking==0.10.2 \
31+ mock==1.3.0 \
32+ pytest==2.9.1 \
33+ pytest-cov>=2.2.1 \
34+ git+https://github.com/F5Networks/pytest-symbols.git \
35+ f5-icontrol-rest==1.0.7 \
36+ pyOpenSSL==16.0.0 \
37+ python-coveralls==2.7.0 \
38+ ordereddict
39+
40+ CMD /bin/bash
Original file line number Diff line number Diff line change 1+ # Dockerfile to build python 3 environment
2+ #
3+ # This dockerfile can be used to build the same python2 environment that we
4+ # use for testing and development. To build the docker container, run the
5+ # following commands.
6+ #
7+ # cd devtools/dockerfiles
8+ # docker build -f Dockerfile.python2 -t python3 .
9+ #
10+ # The docker container can then be used as any other docker containter would
11+ # be used. Connecting to your BIG-IP inside of Vagrant may require that you
12+ # add a forwarded host in Docker to the Vagrant machine itself.
13+ #
14+ # For example,
15+ #
16+ # docker run -it --add-host="localhost:192.168.1.1" \
17+ # -v "${HOME}/src/trupp/f5-common-python:/artifacts" python2
18+ #
19+ # The 192.x address in this case is the IP address of vboxnet0 interfaces on
20+ # your host machine (the one that runs docker and vagrant)
21+
22+ FROM python:3
23+ MAINTAINER @f5networks
24+
25+ RUN mkdir -p /artifacts/coverage
26+ WORKDIR /artifacts
27+
28+ RUN apt-get update && apt-get -y install vim
29+
30+ RUN pip install hacking==0.10.2 \
31+ mock==1.3.0 \
32+ pytest==2.9.1 \
33+ pytest-cov>=2.2.1 \
34+ git+https://github.com/F5Networks/pytest-symbols.git \
35+ f5-icontrol-rest==1.0.7 \
36+ pyOpenSSL==16.0.0 \
37+ python-coveralls==2.7.0
38+
39+ CMD /bin/bash
Original file line number Diff line number Diff line change 1+ # Dockerfiles for testing the f5-sdk
2+
3+ This directory contains Dockerfiles that can be used to test the SDK.
4+
5+ ## Building
6+
7+ To create the necessary docker images, you can use the following commands for...
8+
9+ Python 2
10+
11+ docker build -f Dockerfile.python2 -t python2 .
12+
13+ And Python 3
14+
15+ docker build -f Dockerfile.python2 -t python2 .
16+
17+ ## Running
18+
19+ I use these on a Mac and found that they work as expected. Some explanation is
20+ required
21+
22+ * ` docker run -it -v "${PWD}:/artifacts" --add-host="localhost:192.168.26.66" python2 `
23+ * ` docker run -it -v "${PWD}:/artifacts" --add-host="localhost:192.168.26.66" python3 `
24+
25+ The ` --add-host ` argument lets me communicate with my host machine via that
26+ IP address, but refer to it as "localhost".
You can’t perform that action at this time.
0 commit comments