sgillespie / docker-gitlab-runner

A Dockerized GitLab Runner that automatically registers with the GitLab CI Server
MIT License
4 stars 5 forks source link

Permission error #1

Open Beanow opened 6 years ago

Beanow commented 6 years ago

Trying to set up CI/CD in swarm mode using this image. Jobs won't run due to the home volume having wrong permissions.

Running with gitlab-ci-multi-runner 9.5.0 (413da38)
  on 781dfc338f5e (b4abc558)
Using Shell executor...
Running on 17d1a6b06c96...
mkdir: can't create directory '/home/gitlab-runner/builds/': Permission denied
ERROR: Job failed: exit status 1

I'll test a couple of ideas to see if I can propose a solution.

sgillespie commented 6 years ago

Can you tell give me more details about the environment? What is the volume created? How is the service created?

cloudwitch commented 6 years ago

I'm seeing the same error when trying to build a basic docker image. Here is my swarm compose stanza. The image also needs to be updated to the new 10.x gitlab-runner as the multi-runner has been deprecated.

version: "3.4"
services:
  gitlab:
    image: gitlab/gitlab-ce:latest
    ports:
      - 50180:80
      - 50122:22
    networks:
      - gitlab
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: any
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://example.com/git'
    volumes:
      - type: bind
        source: /opt/docker/gitlab/config
        target: /etc/gitlab
      - type: bind
        source: /opt/docker/gitlab/logs
        target: /var/log/gitlab
      - type: bind
        source: /opt/docker/gitlab/data
        target: /var/opt/gitlab
  gitlab_runner:
    image: sgillespie/gitlab-runner
    networks:
      - gitlab
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: any
    volumes:
      - type: bind
        source: /opt/docker/gitlab/config
        target: /etc/gitlab
    environment:
      - REGISTRATION_TOKEN=token
      - CI_SERVER_URL=http://gitlab_gitlab/git
      - RUNNER_EXECUTOR=shell
      - RUNNER_SHELL=bash

networks:
  gitlab:
robbyemmert commented 5 years ago

I'm suddenly also getting this error. Any ideas?