{"action":"created","issue":{"url":"https://api.github.com/repos/sameersbn/docker-gitlab-ci-runner/issues/17","labels_url":"https://api.github.com/repos/sameersbn/docker-gitlab-ci-runner/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/sameersbn/docker-gitlab-ci-runner/issues/17/comments","events_url":"https://api.github.com/repos/sameersbn/docker-gitlab-ci-runner/issues/17/events","html_url":"https://github.com/sameersbn/docker-gitlab-ci-runner/issues/17","id":71260918,"number":17,"title":"Feature request: Allow changing the runner user","user":{"login":"schmunk42","id":649031,"avatar_url":"https://avatars.githubusercontent.com/u/649031?v=3","gravatar_id":"","url":"https://api.github.com/users/schmunk42","html_url":"https://github.com/schmunk42","followers_url":"https://api.github.com/users/schmunk42/followers","following_url":"https://api.github.com/users/schmunk42/following{/other_user}","gists_url":"https://api.github.com/users/schmunk42/gists{/gist_id}","starred_url":"https://api.github.com/users/schmunk42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmunk42/subscriptions","organizations_url":"https://api.github.com/users/schmunk42/orgs","repos_url":"https://api.github.com/users/schmunk42/repos","events_url":"https://api.github.com/users/schmunk42/events{/privacy}","received_events_url":"https://api.github.com/users/schmunk42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-27T11:51:58Z","updated_at":"2015-04-28T08:47:58Z","closed_at":null,"body":"I tried to make the runner customizable by an ENV var, but somehow I was not able to set the user like so in `assets/setup/install` or `assets/init`:\r\n\r\n    GITLAB_CI_RUNNER_USER=${GITLAB_CI_RUNNER_USER:root}\r\n\r\nAny idea how this could be made possible.\r\nMy use case would be to assign `root` or `docker` as a user to allow the runner to spawn containers on an isolated host."},"comment":{"url":"https://api.github.com/repos/sameersbn/docker-gitlab-ci-runner/issues/comments/96980056","html_url":"https://github.com/sameersbn/docker-gitlab-ci-runner/issues/17#issuecomment-96980056","issue_url":"https://api.github.com/repos/sameersbn/docker-gitlab-ci-runner/issues/17","id":96980056,"user":{"login":"schmunk42","id":649031,"avatar_url":"https://avatars.githubusercontent.com/u/649031?v=3","gravatar_id":"","url":"https://api.github.com/users/schmunk42","html_url":"https://github.com/schmunk42","followers_url":"https://api.github.com/users/schmunk42/followers","following_url":"https://api.github.com/users/schmunk42/following{/other_user}","gists_url":"https://api.github.com/users/schmunk42/gists{/gist_id}","starred_url":"https://api.github.com/users/schmunk42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmunk42/subscriptions","organizations_url":"https://api.github.com/users/schmunk42/orgs","repos_url":"https://api.github.com/users/schmunk42/repos","events_url":"https://api.github.com/users/schmunk42/events{/privacy}","received_events_url":"https://api.github.com/users/schmunk42/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T08:47:58Z","updated_at":"2015-04-28T08:47:58Z","body":"> Please be advised that this is a very risky thing to do. Volume mounting the docker binary and socket inside a docker container renders the host vulnerable.\r\n\r\nI know. My setup is experimental and I use a separate VM for isolation just for runners and containers spawned by them.\r\n\r\n> How will the container get access to the docker daemon? Are you volume mounting the docker binary and socket? \r\n\r\nThe command basically looks like this:\r\n\r\n```\r\ndocker run --name $RUNNER_NAME -it --rm --privileged \\\r\n    -e CI_SERVER_URL=http://192.168.1.40:8080 \\\r\n    -e REGISTRATION_TOKEN=<CAN_BE_FOUND_HERE:https://ci.example.com/admin/runners> \\\r\n    -e CI_RUNNERS_COUNT=1 \\\r\n    -v /Volumes/runners/$RUNNER_NAME/:/home/gitlab_ci_runner/data \\\r\n    -v `which docker`:/usr/bin/docker \\\r\n    -v `which docker-compose`:/usr/local/bin/docker-compose \\\r\n    -v /var/run/docker.sock:/var/run/docker.sock \\\r\n    schmunk42/gitlab-ci-runner\r\n```\r\n\r\n[Modified docker runner](https://github.com/sameersbn/docker-gitlab-ci-runner/compare/master...schmunk42:master)\r\n\r\n> I think you should look at drone.io. Its a CI platform that creates a new container to run the tests. I think drone.io integrates with gitlab.\r\n\r\nI did look at that, but using your docker containers are way cooler ;) because I want to test whole application container stacks, defined in a yml file. Which is easily possible with the runner concept as docker container.\r\nDrone works on this, I remember a StackOverflow question about it, but is currently limited to predefined containers.\r\n\r\n"}}