Skip to content

Commit 55170d1

Browse files
committed
Adds dockerfiles for development
Issues: Fixes #695 Problem: Dockerfiles did not exist in the repo so there was no convenient way for existing developers to test and dev the SDK on a known platform Analysis: This patch adds dockerfiles so that there is a common dev platform Tests: none
1 parent 6a13161 commit 55170d1

4 files changed

Lines changed: 106 additions & 0 deletions

File tree

devtools/dockerfiles/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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

devtools/dockerfiles/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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".

0 commit comments

Comments
 (0)