TruCol / Self-host-GitLab-CI-for-GitHub

Installs your own GitLab CI and runs it on all your GitHub repos, in a single command.
GNU Affero General Public License v3.0
4 stars 3 forks source link

Failed to connect to 127.0.0.1 port 80 after 0 ms: Connection refused #122

Closed a-t-0 closed 2 years ago

a-t-0 commented 2 years ago

Ensure the Docker runner is able to connect with the gitlab server.

Error can be resolved with:

sudo gitlab-runner register \
  --non-interactive \
  --url http://127.0.0.1 \
  --registration-token "sometoken" \
  --description "docker4" \
  --docker-image "docker:20.10.16" \
  --executor "docker" \
  --docker-privileged \
  --docker-volumes "/certs/client" \
  --docker-network-mode host

The docker-network-mode is selected from output:

docker network ls

Based on: https://stackoverflow.com/questions/61798689/mavenlatest-image-from-gitlab-runner-with-docker-executer-failed-to-connect-to/61812661#comment130763167_61812661

a-t-0 commented 2 years ago

This passed:

test:pytest:36:
  image: python:3.6
  script:
    - whoami
    - apt-get update && apt-get install -y python
    - apt-get install python
    - apt-get update --fix-missing
    - wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; bash miniconda.sh -b -f -p $HOME/miniconda;
    - export PATH="$HOME/miniconda/bin:$PATH"
    - conda env create -q -f environment.yml -n example_env --force
    - source activate example_env
    - conda install pytest
    - python -m pytest
a-t-0 commented 2 years ago

It is fixed, the GitLab docker runner works automatically after installation.