J'ai donc cette configuration où dans un conteneur Docker j'ai besoin d'exécuter une suite de tests de la bibliothèque python (conçue pour mon entreprise) et dans ma suite de tests pour notre Redis Connector, la création d'un locaclhost:6379
Le serveur redis est refusé.Redis python ne peut pas créer de serveur local dans Docker
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
Les test_redis.py
passages dans un environnement ouvert avec nose
mais échoue dans l'intégration continue (à moins Docker).
Est-ce que Docker bloque tous les services localhost
ou est-ce que j'utilise une mauvaise approche?
Configuration
Ubuntu 17.04
Docker version 1.12.6, build 78d1802
Dockerfile:
FROM continuumio/miniconda3:4.3.14
MAINTAINER ... <[email protected]>
WORKDIR /app
RUN which conda && which python && which pip && apt update && apt install -y build-essential libblas-dev liblapack-dev libatlas-base-dev gfortran
RUN conda install -y numpy && conda install -y scikit-learn && conda install -y scipy
RUN apt update && apt install -y libmysqlclient-dev
COPY . /app/maids
RUN cd /app/maids/ && pip install -e .
aide Makefile construire commande:
test_docker_light_py3: #build_datascience_base3
docker run -e GCS_BUCKET=${GCS_BUCKET} -e GCS_BUCKET_TEST=${GCS_BUCKET_TEST} -e TEST_DATASET=${TEST_DATASET} -e TEST_DATASET_2=${TEST_DATASET_2} -e DOC_SSH_HOST=${DOC_SSH_HOST} -e DOC_SSH_PATH=${DOC_SSH_PATH} -v $(shell pwd):/app -i -t "${LOCAL_TEST_IMAGE3}" /bin/bash -c "python --version ; pip freeze ; python -m 'nose' -a '!slow' --nologcapture --nocapture --with-coverage --cover-package=maids --with-timer --timer-top-n 10 tests/*.py"