Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Looking for answers: How to get docker daemon running in pipeline container? #45

Closed
wants to merge 2 commits into from

Conversation

fnbk
Copy link

@fnbk fnbk commented Jun 26, 2018

Hi I am trying to get the docker daemon running inside a container of a pipeline step.

I included a new sample (sample_11). It basically creates a docker container and calls /usr/local/bin/dockerd inside a shell script, but it leads to a permission dienied error: containerd: write /proc/17/oom_score_adj: permission denied

pipeline.yml

workspace:
  base: /go
  path: src/github.com/fnbk/hello

pipeline:
  test:
    image: fnbk/drone-daemon

fnbk/drone-daemon: https://github.com/fnbk/drone-daemon

fnbk/drone-daemon/run.sh

#!/bin/sh

/usr/local/bin/dockerd     # <= ERROR: containerd: write /proc/17/oom_score_adj: permission denied

# ...

full output of pipec exec

florian@florians-mbp ~/p/g/s/g/f/p/s/sample_11> pipec exec
proc "pipeline_clone" started
+ git init
Initialized empty Git repository in /go/src/github.com/fnbk/hello/.git/
+ git remote add origin https://github.com/fnbk/hello.git
+ git fetch --no-tags origin +refs/heads/master:
From https://github.com/fnbk/hello
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
+ git reset --hard -q 48bc6acaaea144b068a307b14cbdd19768861a08
+ git submodule update --init --recursive
proc "pipeline_clone" exited with status 0
proc "pipeline_step_0" started

starting docker daemon
time="2018-06-26T14:50:00.348494500Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2018-06-26T14:50:00.352976500Z" level=info msg="libcontainerd: started new docker-containerd process" pid=17
time="2018-06-26T14:50:00Z" level=info msg="starting containerd" module=containerd revision=89623f28b87a6004d4b785663257362d1658a729 version=v1.0.0
time="2018-06-26T14:50:00Z" level=info msg="setting subreaper..." module=containerd
time="2018-06-26T14:50:00Z" level=info msg="changing OOM score to -500" module=containerd
containerd: write /proc/17/oom_score_adj: permission denied
time="2018-06-26T14:50:00.371635300Z" level=error msg="containerd did not exit successfully" error="exit status 1" module=libcontainerd
Failed to connect to containerd: failed to dial "/var/run/docker/containerd/docker-containerd.sock": dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout

wait for daemon to start
sleeping
could not connect to docker daemon
proc "pipeline_step_0" exited with status 1
pipeline_step_0 : exit code 1

I am trying to understand how to get the daemon running inside a container. It would be great if you could give me some hints. Thanks.

@fnbk
Copy link
Author

fnbk commented Jul 4, 2018

Whitelisting fnbk/drone-daemon as privileged resolves this issue. See: cf941f0

@fnbk fnbk closed this Jul 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant