I try to run GitLab Runner with docker executor inside LXD container. Have it done half way through but still not functioning properly.
Did anybody happen to have it up and running and could share how to do it ?
I try to run GitLab Runner with docker executor inside LXD container. Have it done half way through but still not functioning properly.
Did anybody happen to have it up and running and could share how to do it ?
You have to set your docker container to run as privileged. Check the runner config.toml file and set like this:
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
shm_size = 0
[runners.cache]
Insecure = false
Also make sure that you have launched your LXC container with the paramaters:
lxc launch --verbose IMAGE CONTAINER_NAME -c security.nesting=true -c security.privileged=true
Plus check the LXC profile to be set like this:
config:
raw.lxc: |-
lxc.apparmor.profile = unconfined
lxc.cgroup.devices.allow = a
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop=
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: lxd-pa
type: disk
name: default
In case that even those settings won't change the docker container behavior, try to disable apparmor on the LXC container
Problem sorted out by doing everything by below steps
install lxd container as per https://stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/
install gitlab-runner as per https://docs.gitlab.com/runner/install/linux-repository.html
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html