Giter Site home page Giter Site logo

docker-gitlab-ci-multi-runner's Introduction

Docker Repository on Quay.io

sameersbn/gitlab-ci-multi-runner:1.1.4-7

Introduction

Dockerfile to create a Docker container base image for gitlab-ci-multi-runner. Use this image to build your CI runner images.

Contributing

If you find this image useful here's how you can help:

  • Send a pull request with your awesome features and bug fixes
  • Help users resolve their issues.
  • Support the development of this image with a donation

Issues

Before reporting your issue please try updating Docker to the latest version and check if it resolves the issue. Refer to the Docker installation guide for instructions.

SELinux users should try disabling SELinux using the command setenforce 0 to see if it resolves the issue.

If the above recommendations do not help then report your issue along with the following information:

  • Output of the docker version and docker info commands
  • The docker run command or docker-compose.yml used to start the image. Mask out the sensitive bits.
  • Please state if you are using Boot2Docker, VirtualBox, etc.

Getting started

Installation

Automated builds of the image are available on Dockerhub and is the recommended method of installation.

Note: Builds are also available on Quay.io

docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-7

Alternatively you can build the image yourself.

docker build -t sameersbn/gitlab-ci-multi-runner github.com/sameersbn/docker-gitlab-ci-multi-runner

Quickstart

Before a runner can process your CI jobs, it needs to be authorized to access the the GitLab CI server. The CI_SERVER_URL, RUNNER_TOKEN, RUNNER_DESCRIPTION and RUNNER_EXECUTOR environment variables are used to register the runner on GitLab CI.

docker run --name gitlab-ci-multi-runner -d --restart=always \
  --volume /srv/docker/gitlab-runner:/home/gitlab_ci_multi_runner/data \
  --env='CI_SERVER_URL=http://git.example.com/ci' --env='RUNNER_TOKEN=xxxxxxxxx' \
  --env='RUNNER_DESCRIPTION=myrunner' --env='RUNNER_EXECUTOR=shell' \
  sameersbn/gitlab-ci-multi-runner:1.1.4-7

Alternatively, you can use the sample docker-compose.yml file to start the container using Docker Compose

Update the values of CI_SERVER_URL, RUNNER_TOKEN and RUNNER_DESCRIPTION in the above command. If these enviroment variables are not specified, you will be prompted to enter these details interactively on first run.

Command-line arguments

You can customize the launch command by specifying arguments to gitlab-ci-multi-runner on the docker run command. For example the following command prints the help menu of gitlab-ci-multi-runner command:

docker run --name gitlab-ci-multi-runner -it --rm \
  --volume /srv/docker/gitlab-runner:/home/gitlab_ci_multi_runner/data \
  sameersbn/gitlab-ci-multi-runner:1.1.4-7 --help

Persistence

For the image to preserve its state across container shutdown and startup you should mount a volume at /home/gitlab_ci_multi_runner/data.

The Quickstart command already mounts a volume for persistence.

SELinux users should update the security context of the host mountpoint so that it plays nicely with Docker:

mkdir -p /srv/docker/gitlab-runner
chcon -Rt svirt_sandbox_file_t /srv/docker/gitlab-runner

Deploy Keys

At first run the image automatically generates SSH deploy keys which are installed at /home/gitlab_ci_multi_runner/data/.ssh of the persistent data store. You can replace these keys with your own if you wish to do so.

You can use these keys to allow the runner to gain access to your private git repositories over the SSH protocol.

NOTE

  • The deploy keys are generated without a passphrase.
  • If your CI jobs clone repositories over SSH, you will need to build the ssh known hosts file which can be done in the build steps using, for example, ssh-keyscan github.com | sort -u - ~/.ssh/known_hosts -o ~/.ssh/known_hosts.

Trusting SSL Server Certificates

If your GitLab server is using self-signed SSL certificates then you should make sure the GitLab server's SSL certificate is trusted on the runner for the git clone operations to work.

The runner is configured to look for trusted SSL certificates at /home/gitlab_ci_multi_runner/data/certs/ca.crt. This path can be changed using the CA_CERTIFICATES_PATH enviroment variable.

Create a file named ca.crt in a certs folder at the root of your persistent data volume. The ca.crt file should contain the root certificates of all the servers you want to trust.

With respect to GitLab, append the contents of the gitlab.crt file to ca.crt. For more information on the gitlab.crt file please refer the README of the docker-gitlab container.

Similarly you should also trust the SSL certificate of the GitLab CI server by appending the contents of the gitlab-ci.crt file to ca.crt.

Maintenance

Upgrading

To upgrade to newer releases:

  1. Download the updated Docker image:
docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-7
  1. Stop the currently running image:
docker stop gitlab-ci-multi-runner
  1. Remove the stopped container
docker rm -v gitlab-ci-multi-runner
  1. Start the updated image
docker run -name gitlab-ci-multi-runner -d \
  [OPTIONS] \
  sameersbn/gitlab-ci-multi-runner:1.1.4-7

Shell Access

For debugging and maintenance purposes you may want access the containers shell. If you are using Docker version 1.3.0 or higher you can access a running containers shell by starting bash using docker exec:

docker exec -it gitlab-ci-multi-runner bash

List of runners using this image

docker-gitlab-ci-multi-runner's People

Contributors

outcoldman avatar veggiemonk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-gitlab-ci-multi-runner's Issues

How can I interconnect this with gitlab in docker on the same host?

I have ran you gitlab in docker and I would like to connect multi-runner to it but I am getting

Starting dockergitlabcimultirunner_GitlabCIMultiRunner_1...
Attaching to dockergitlabcimultirunner_GitlabCIMultiRunner_1
GitlabCIMultiRunner_1 | time="2015-09-25T18:41:11Z" level=error msg="Couldn't execute POST against 172.17.42.1/api/v1/runners/register.json: Post 172.17.42.1/api/v1/runners/register.json: unsupported protocol scheme \"\"" 
GitlabCIMultiRunner_1 | time="2015-09-25T18:41:11Z" level=error msg="79e66ea0 Registering runner... failed" 
GitlabCIMultiRunner_1 | time="2015-09-25T18:41:11Z" level=fatal msg="Failed to register this runner. Perhaps you are having network problems" 
.....

I have added external_link in the docker-compose.yml

GitlabCIMultiRunner:
  image: sameersbn/gitlab-ci-multi-runner:0.5.5
  external_links:
    - dockergitlab_gitlab_1
  volumes:
    - /opt/gitlab-ci-multi-runner:/home/gitlab_ci_multi_runner/data
  environment:
    - CI_SERVER_URL=172.17.42.1
    - RUNNER_TOKEN=79e66ea069a011eae67c
    - RUNNER_DESCRIPTION=first_runner
    - RUNNER_EXECUTOR=shell
  restart: always

Am I doing this in correct way? The IP address I have put there is the ifconfig docker0 from gitlab instance. I have tried with:

  • 172.17.42.1
  • 172.17.42.1:10800
  • localhost
  • localhost:10800

with the same results

Gitlab containers are running as follows:

CONTAINER ID        IMAGE                        COMMAND                CREATED             STATUS              PORTS                                                                  NAMES
37d346a08f67        sameersbn/gitlab:8.0.2       "/sbin/entrypoint.sh   About an hour ago   Up About an hour    0.0.0.0:10022->22/tcp, 0.0.0.0:10080->80/tcp, 0.0.0.0:32788->443/tcp   dockergitlab_gitlab_1       
e2f3dba05391        sameersbn/redis:latest       "/sbin/entrypoint.sh   21 hours ago        Up About an hour    0.0.0.0:32787->6379/tcp                                                dockergitlab_redis_1        
afd6764750d7        sameersbn/postgresql:9.4-3   "/start"               21 hours ago        Up About an hour    0.0.0.0:32786->5432/tcp                                                dockergitlab_postgresql_1 

register in multiple gitlab-ci hosts

@sameersbn do you know if it is possible to register 1 multi-runner in multiple gitlab-ci containers?
in this moment i have 2 gitlab containers sharing the /home/git/data folder, but when i check the gitlab registration token they are different in the 2 container's.

How to let docker runner not pull images from web

I have these warnings

Running with gitlab-ci-multi-runner 1.6.1 (c52ad4f)
Using Docker executor with image ubuntu16.04.python:packages ...
Pulling docker image ubuntu16.04.python:packages ...
WARNING: Cannot pull the latest version of image ubuntu16.04.python:packages : Error: image library/ubuntu16.04.python not found
WARNING: Locally found image will be used instead.

how to let runner not to pull images from web first, instead of find in local first?

Alpine Base?

I think we could go down to about 60MB using alpine linux instead of ubuntu.

server certificate verification failed - Let's Encrypt Certificate

Hello

i'm running GitLab on my Synology with a Let's Encrypt Certificate.

When i start my pipeline procress i get the following error message.

gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
Using Shell executor...
Running on 1567fe55aaf2...
Cloning repository...
Cloning into '/home/gitlab_ci_multi_runner/data/builds/4e31f1b9/0/user/test'...
fatal: unable to access 'https://gitlab-ci-token:[email protected]:30000/user/test.git/': server certificate verification failed. CAfile: /home/gitlab_ci_multi_runner/data/builds/4e31f1b9/0/user/test.tmp/GIT_SSL_CAINFO CRLfile: none

ERROR: Build failed: exit status 1

Let's Encrypt provides:
cert.pem
chain.pem
privkey.pem

How can i provide gitlab runner the correct certificate format?

Any plans for updating to GitLab 9.4?

Thanks for all your work with GitLab and Docker. I am grateful beyond words!

I was wondering if you have any plans to update this great repo to GitLab 9.4.

Cannot start container

Hi @sameersbn,

Great work on docker-gitlab... and this CI runner is just awesome!

I received an error when starting the container.
The problem is with the register command in entrypoint.sh.
There are no -d flag but there is a --name flag.
Same goes for the -e flag ---> --executor

Here is the error log:

GitlabCIMultiRunner_1 | time="2015-10-14T06:02:41Z" level=fatal msg="flag provided but not defined: -d" 
GitlabCIMultiRunner_1 | Incorrect Usage.
GitlabCIMultiRunner_1 | 
GitlabCIMultiRunner_1 | NAME:
GitlabCIMultiRunner_1 |    register - register a new runner
GitlabCIMultiRunner_1 | 
GitlabCIMultiRunner_1 | USAGE:
GitlabCIMultiRunner_1 |    command register [command options] [arguments...]
GitlabCIMultiRunner_1 | 
GitlabCIMultiRunner_1 | OPTIONS:
GitlabCIMultiRunner_1 |    -c, --config "/home/gitlab_ci_multi_runner/data/config.toml" Config file [$CONFIG_FILE]
GitlabCIMultiRunner_1 |    --tag-list                                                   Tag list [$RUNNER_TAG_LIST]
GitlabCIMultiRunner_1 |    -n, --non-interactive                                        Run registration unattended [$REGISTER_NON_INTERACTIVE]
GitlabCIMultiRunner_1 |    --leave-runner                                               Don't remove runner if registration fails [$REGISTER_LEAVE_RUNNER]
GitlabCIMultiRunner_1 |    -r, --registration-token "3782150aed217f35b54f"              Runner's registration token [$REGISTRATION_TOKEN]
GitlabCIMultiRunner_1 |    -u, --url "http://srhs99.groups.local:10080/ci"              Runner URL [$CI_SERVER_URL]
GitlabCIMultiRunner_1 |    -t, --token                                                  Runner token [$CI_SERVER_TOKEN]
GitlabCIMultiRunner_1 |    --name "3059e8844de1"                                        Runner name [$RUNNER_NAME]
GitlabCIMultiRunner_1 |    --limit                                                      Maximum number of builds processed by this runner [$RUNNER_LIMIT]
GitlabCIMultiRunner_1 |    --executor "shell"                                           Select executor, eg. shell, docker, etc. [$RUNNER_EXECUTOR]
GitlabCIMultiRunner_1 |    --builds-dir                                                 Directory where builds are stored [$RUNNER_BUILDS_DIR]
GitlabCIMultiRunner_1 |    --env                                                        Custom environment variables injected to build environment [$RUNNER_ENV]
GitlabCIMultiRunner_1 |    --shell                                                      Select bash, cmd or powershell [$RUNNER_SHELL]
GitlabCIMultiRunner_1 |    --ouput-limit                                                Maximum build trace size [$RUNNER_OUTPUT_LIMIT]
GitlabCIMultiRunner_1 |    --ssh-user                                                   User name [$SSH_USER]
GitlabCIMultiRunner_1 |    --ssh-password                                               User password [$SSH_PASSWORD]
GitlabCIMultiRunner_1 |    --ssh-host                                                   Remote host [$SSH_HOST]
GitlabCIMultiRunner_1 |    --ssh-port                                                   Remote host port [$SSH_PORT]
GitlabCIMultiRunner_1 |    --ssh-identity-file                                          Identity file to be used [$SSH_IDENTITY_FILE]
GitlabCIMultiRunner_1 |    --docker-host                                                Docker daemon address [$DOCKER_HOST]
GitlabCIMultiRunner_1 |    --docker-cert-path                                           Certificate path [$DOCKER_CERT_PATH]
GitlabCIMultiRunner_1 |    --docker-tlsverify                                           Use TLS and verify the remote [$DOCKER_TLS_VERIFY]
GitlabCIMultiRunner_1 |    --docker-hostname                                            Custom container hostname [$DOCKER_HOSTNAME]
GitlabCIMultiRunner_1 |    --docker-image                                               Docker image to be used [$DOCKER_IMAGE]
GitlabCIMultiRunner_1 |    --docker-privileged                                          Give extended privileges to container [$DOCKER_PRIVILEGED]
GitlabCIMultiRunner_1 |    --docker-disable-cache                                       Disable all container caching [$DOCKER_DISABLE_CACHE]
GitlabCIMultiRunner_1 |    --docker-volumes                                             Bind mount a volumes [$DOCKER_VOLUMES]
GitlabCIMultiRunner_1 |    --docker-cache-dir                                           Directory where to store caches [$DOCKER_CACHE_DIR]
GitlabCIMultiRunner_1 |    --docker-extra-hosts                                         Add a custom host-to-IP mapping [$DOCKER_EXTRA_HOSTS]
GitlabCIMultiRunner_1 |    --docker-links                                               Add link to another container [$DOCKER_LINKS]
GitlabCIMultiRunner_1 |    --docker-services                                            Add service that is started with container [$DOCKER_SERVICES]
GitlabCIMultiRunner_1 |    --docker-wait-for-services-timeout                           How long to wait for service startup [$DOCKER_WAIT_FOR_SERVICES_TIMEOUT]
GitlabCIMultiRunner_1 |    --docker-allowed-images                                      Whitelist allowed images [$DOCKER_ALLOWED_IMAGES]
GitlabCIMultiRunner_1 |    --docker-allowed-services                                    Whitelist allowed services [$DOCKER_ALLOWED_SERVICES]
GitlabCIMultiRunner_1 |    --parallels-base-name                                        VM name to be used [$PARALLELS_BASE_NAME]
GitlabCIMultiRunner_1 |    --parallels-template-name                                    VM template to be created [$PARALLELS_TEMPLATE_NAME]
GitlabCIMultiRunner_1 |    --parallels-disable-snapshots                                Disable snapshoting to speedup VM creation [$PARALLELS_DISABLE_SNAPSHOTS]
GitlabCIMultiRunner_1 |    --docker-mysql                                               MySQL version (or specify latest) to link as service Docker service [$DOCKER_MYSQL]
GitlabCIMultiRunner_1 |    --docker-postgres                                            PostgreSQL version (or specify latest) to link as service Docker service [$DOCKER_POSTGRES]
GitlabCIMultiRunner_1 |    --docker-mongo                                               MongoDB version (or specify latest) to link as service Docker service [$DOCKER_MONGO]
GitlabCIMultiRunner_1 |    --docker-redis                                               Redis version (or specify latest) to link as service Docker service [$DOCKER_REDIS]
GitlabCIMultiRunner_1 |    
GitlabCIMultiRunner_1 | time="2015-10-14T06:02:47Z" level=fatal msg="flag provided but not defined: -d" 
dockergitlabcimultirunner_GitlabCIMultiRunner_1 exited with code 0

PR is comming right away.

Cheers,

Julien

Docker executor couldn't connect to the local gitlab

My case is simply to host a gitlab and a CI runner together inside of my local docker on my mac.
I can see the runner is recognized by gitlab but it looks like the runners docker is unable to fetch repository from it. I'd been searching a lot but just can't fix my problem. I guess it's due to the network settings of the "temp" container created by my runner container. Here's my .yml file which's aiming to create a self-hosted gitlab & gitlab-runner. Hope anyone has any idea to help me to get it work.

version: '2'

services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    container_name: 'gitlab'
    restart: always
    hostname: 'gitlab.local.com'   # I just add this domain name locally in my etc/hosts file
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab.local.com:80'
        gitlab_rails['gitlab_shell_ssh_port'] = 22
    ports:
      - '80:80'
      - '22:22'
    volumes:
      - โ€˜/somewhere-on-my-mac/config:/etc/gitlab'
      - '/somewhere-on-my-mac/logs:/var/log/gitlab'
      - '/somewhere-on-my-mac/data:/var/opt/gitlab'

  node-runner:
    container_name: 'gitlab-runner-node'
    image: sameersbn/gitlab-ci-multi-runner
    volumes:
      - /somewhere-on-my-mac/node-runner/data:/home/gitlab_ci_multi_runner/data
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - CI_SERVER_URL=http://gitlab/ci
      - RUNNER_TOKEN=myTokenCode
      - RUNNER_DESCRIPTION=NODE CI RUNNER
      - RUNNER_EXECUTOR=docker
      - DOCKER_IMAGE=node:7-slim
    restart: always
    links:
      - gitlab

CI thrown messages like this:

gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
Using Docker executor with image node:7-slim ...
Pulling docker image node:7-slim ...

Running on runner-feee1e28-project-2-concurrent-0 via c21641d594e3...
Cloning repository...
Cloning into '/builds/Robin/ci-demo'...
fatal: unable to access 'http://gitlab-ci-token:[email protected]/Robin/ci-demo.git/': Failed to connect to gitlab.local.com port 80: Connection refused

ERROR: Build failed: exit code 1

with adding the links = [gitlab] into the [runners.docker] section I got this instead:

gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
Using Docker executor with image node:7-slim ...
Pulling docker image node:7-slim ...


ERROR: Build failed: API error (500): Cannot link to /gitlab, as it does not belong to the default network

runner v1.1.0

https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/CHANGELOG.md

New features

v 1.1.0
Use Go 1.5
Change license to MIT
Add docker-machine based auto-scaling for docker executor
Add support for external cache server
Add support for sh, allowing to run builds on images without the bash
Add support for passing the artifacts between stages
Add docker-pull-policy, it removes the docker-image-ttl
Add docker-network-mode
Add git to gitlab-runner:alpine
Add support for CapAdd, CapDrop and Devices by docker executor
Add support for passing the name of artifacts archive (artifacts:name)
Add support for running runner as system service on OSX
Refactor: The build trace is now implemented by network module
Refactor: Remove CGO dependency on Windows
Fix: Create alternative aliases for docker services (uses -)
Fix: VirtualBox port race condition
Fix: Create cache for all builds, including tags
Fix: Make the shell executor more verbose when the process cannot be started
Fix: Pass gitlab-ci.yml variables to build container created by docker executor
Fix: Don't restore cache if not defined in gitlab-ci.yml
Fix: Always use json-file when starting docker containers
Fix: Error level checking for Windows Batch and PowerShell

From the list does not seem like any additional work is required other than bump the version to 1.1.0

Docker executor cannot pull image from private registry

I use gitlab-ci-multi-runner:1.0.4, here is code snippet of my docker-compose.yml:

GitlabCIMultiRunner:
  image: sameersbn/gitlab-ci-multi-runner:1.0.4
  volumes:
    # share Docker unix sock
    - /var/run/docker.sock:/var/run/docker.sock
    # share docker config for using docker registry
    - ~/.docker:/root/.docker

I get this problem when doing ci build, Docker executor cannot pull image from private registry:

Using Docker executor with image docker.163.com/pyenv-common:latest ...
Pulling docker image my-private-registry/pyenv-common:latest ...
WARNING: Cannot pull the latest version of image docker.163.com/pyenv-common:latest : Error: image pyenv-common:latest not found
WARNING: Locally found image will be used instead.

Running on runner-b0913476-project-2-concurrent-0 via 5f6196c6c24c...

I change the shared docker config folder to:

 - ~/.docker:/home/gitlab_ci_multi_runner/.docker

but this still not work.

And I change to use the GitLab official Runner image, it work.

image: gitlab/gitlab-runner:latest

I want to know what is the difference and how to make this gitlab-ci-multi-runner work as the offical one.

Unable to connect on same host

Hi, and first thanks a lot for your docker gitlab images. I run them since 14 month without to have to complain :)

I've got a problem to run ci-multi-runner on the same host. I've got this output

gitlab-ci-multi-runner 1.1.3 (a470667)
WARNING: image is not supported by selected executor and shell
Using Shell executor...
Running on 0e608eb62373...
Cloning repository...
Cloning into '/home/gitlab_ci_multi_runner/data/builds/f7eeb9e6/0/metal3d/test-ci'...
fatal: unable to access 'https://gitlab-ci-token:[email protected]/metal3d/test-ci.git/': Failed to connect to git.develipsum.com port 443: Connection refused

ERROR: Build failed: exit status 1

Actually git.develipsum.com is served by a reverse proxy. I can access it outside and on my host. But not inside the "runner" container.

This is my docker-compose that runs:

GitlabCIMultiRunner:
  image: sameersbn/gitlab-ci-multi-runner:1.1.3-1
  volumes:
    - ./data:/home/gitlab_ci_multi_runner/data
    - /var/run/docker.sock:/var/run/docker.sock
  environment:
    - CI_SERVER_URL=http://gitlab/ci
    - RUNNER_TOKEN=XXXXXXXXXXXXXXXXx
    - RUNNER_DESCRIPTION=Docker CI runner
    - RUNNER_EXECUTOR=docker
  restart: always
  external_links:
    - gitlab

"gitlab" link is my gitlab 8.6.7 (your image) and the runner is correctly registered.

CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS                                                NAMES
0e608eb62373        sameersbn/gitlab-ci-multi-runner:1.1.3-1   "/sbin/entrypoint.sh"    10 minutes ago      Up 10 minutes                                                            gitlabrunner_GitlabCIMultiRunner_1
5396398c5a12        sameersbn/gitlab:8.6.7                     "/sbin/entrypoint.sh "   14 minutes ago      Up 14 minutes       0.0.0.0:22->22/tcp, 443/tcp, 0.0.0.0:10880->80/tcp   gitlab

Note that:

docker exec -it gitlabrunner_GitlabCIMultiRunner_1 bash
root@0e608eb62373:/home/gitlab_ci_multi_runner# ping git.develipsum.com
PING gitlab (172.17.0.1) 56(84) bytes of data.
64 bytes from gitlab (172.17.0.1): icmp_seq=1 ttl=64 time=0.214 ms
64 bytes from gitlab (172.17.0.1): icmp_seq=2 ttl=64 time=0.171 ms

As you can see, actually, runner takes the private network address and not the public one. It resolves the name to "gitlab" that is my container name. So I imagine that the runner tries to connect to 172.17.0.1:443 that is not served by nginx reverse proxy (wich uses validated certificate)

The connection is refused.

Is it possible to run `docker build` and `docker push` inside a container of this image?

I would like to build and push docker images inside a docker container. I want to setup a CI-Environment where docker images are being built and pushed after a git commit has been pushed to gitlab.

I've read about using Docker inside Docker, but since i just want to build and push, this seems to be a little overweight and there is important security issues to be considered (http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/)

Is there a more straight forward way to do this?

Gitlab Version: CE 8.2.3
Docker Version: 1.9.1

Thank you very much

Edit: Excuse me, I didn't realize that #5 talks about just that.

Using docker executor

Is it possible to use the docker executor with this image? If so how do I supply the base image and link services?

SSH deploy key isn't available to runner

The deploy keys don't appear to be usable by runners that want to git clone during a build phase.

I have copied id_rsa.pub from the containers /home/gitlab_ci_multi_runner/data/.ssh into Deploy Keys for a project but still get "Host key verification failed".

gitlab-ci-multi-runner 0.6.2 (3227f0a)
Using Shell executor...
Running on gitlab-ci-1...

Fetching changes...
Checking out 21ac0542 as master...

$ mkdir deploy
$ cd deploy
$ git clone [email protected]:my/repo.git -b production --single-branch .
Cloning into '.'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ERROR: Build failed with: exit status 1

Allow configuration of sentry_dsn

Since v1.4.0 it is possible to specify a sentry_dsn for gitlab CI runners. It would be great to be able to specify this via an environment variable via docker!

Thanks you !

Just to say thanks ^^

Woa, maybe the first time I found something that works straighaway ^^

A single docker-compose.yml to run gitlab and the CI family, wonderful!

Auto unregister option

I have many runners on many different projects and i must unregister them manually.

I'll add a RUNNER_AUTOUNREGISTER option to remove automatically the runner from its gitlab instance on container stop.

A problem for deploy

This is my .gitlab-ci.yml

stages:
  - build
  - test
  - deploy

python-build:
  stage: build
  tags:
    - ubuntu16.04
    - build
    - python
  environment: build-stage
  before_script:
    - pwd
    - ls -al ./
  script:
    - python setup.py sdist
    - ls -al ./
  artifacts:
    name: "test-mxc"
    paths:
    - bin
    expire_in: 1 week

python-test:
  stage: test
  tags:
    - ubuntu16.04
    - python
    - test
  before_script:
    - pwd
    - ls -al ./
  script:
    - python setup.py test

python-deploy:
  stage: deploy
  tags:
    - deploy
    - python
  allow_failure: true
  before_script:
    - hostname
    - whoami
  script:
    - pwd
    - ls .
  after_script:
    - rm -rf ~/builds

When gitlab-ci runs in deploy stage, there is a error which i don't know why

Running with gitlab-ci-multi-runner 1.6.1 (c52ad4f)
Using SSH executor...
Running on berry_testserver via 7ab9ea84591a...
Fetching changes...
HEAD is now at 99d4359 Add before_script
From http://192.168.4.6:10080/bixichao/python-mxcfun
 + 99d4359...5641972 master     -> origin/master  (forced update)
Checking out 56419722 as master...
Downloading artifacts for python-build (61)...
Downloading artifacts from coordinator... ok        id=61 responseStatus=200 OK token=9uZ8mCME
FATAL: zip: not a valid zip file                   
ERROR: Build failed: Process exited with: 1. Reason was:  ()

npm: command not found

I would like to setup an angular deploy.
No matter the executor I select (shell or docker) I get the following output.

`gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
WARNING: image is not supported by selected executor and shell
Using Shell executor...
Running on 6687502ce71f...
Fetching changes...
HEAD is now at 42e9d51 Update .gitlab-ci.yml
Checking out 42e9d511 as master...
HEAD is now at 42e9d51... Update .gitlab-ci.yml
Checking cache for default...
$ npm prune
bash: line 56: npm: command not found

ERROR: Build failed: exit status 1`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.