0

I use self-host gitlab to run ci testing with docker:dind image. I run the command apk add --no-cache py-pip and pip install docker-compose. But it got the error below.

Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 659, in unpack_http_url
    hashes)
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 853, in _download_http_url
    stream=True,
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

I have try to use - pip install requests==2.15.1; pip uninstall -y certifi and pip install -upgrade pip --trusted-host pypi.python.org But I still got this error. I am not sure it's my configuration about gitlab is wrong or the docker image. Please help me resolve this problem.

Here is my gitab-ci.yml

image: docker:latest
services:
  - docker:dind

# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
  DOCKER_DRIVER: overlay2
  BUILD_TAG: $CI_JOB_NAME-$CI_JOB_ID

stages:
  - test

before_script:
  - apk add --no-cache py-pip
  - pip install requests==2.15.1
  - pip uninstall -y certifi
  - pip install docker-compose

after_script:
  - docker system prune --filter "label=CI-TEST=$BUILD_TAG" -af

test:
  stage: test
  script:
    - sed -i 's/TAG/'$CI_JOB_ID'/g' ./docker/Dockerfile-web
    - sed -i 's/ci-label/'$BUILD_TAG'/g' ./docker/Dockerfile-base
    - sed -i 's/ci-label/'$BUILD_TAG'/g' ./docker/docker-compose-test.yml
    - sed -i 's/ci-network/'$BUILD_TAG'/g' ./docker/docker-compose-test.yml
    - docker build -f docker/Dockerfile-base --build-arg DOCKER_TEST=true -t bizcloud_base:$CI_JOB_ID .
    - docker-compose -f docker/docker-compose-test.yml up --build --abort-on-container-exit
Rukeith
  • 665
  • 1
  • 8
  • 22
  • 1
    Possible duplicate of [pip install fails for every package ("Could not find a version that satisfies the requirement")](https://stackoverflow.com/questions/49748063/pip-install-fails-for-every-package-could-not-find-a-version-that-satisfies-th) – Anupam Apr 17 '18 at 08:40
  • Could you tell me please which version of docker-compose are you trying to install, please? – Alejandro Galera Apr 17 '18 at 08:52
  • @AlexGalera I have not limited version, so docker-compose version will be the latest version. – Rukeith Apr 18 '18 at 00:43

0 Answers0