logimethods / docker-jenkins Goto Github PK
View Code? Open in Web Editor NEWTo allow Docker based builds through a Docker running Jenkins Server
License: MIT License
To allow Docker based builds through a Docker running Jenkins Server
License: MIT License
Hi,
I'm trying to use this setup within my kubernetes environment. I tried to follow the GCE Jenkins tutorial but run into the docker
problem. Here is the Issue in their repo.
I'm a little bit new to k8s, but I have the following the deployment.yaml. How do I tell k8s the initial docker run commands? Maybe this will help someone here.
I get a build error:
+ docker build -t eu.gcr.io/rxxxx/apiservice:master.1 .
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
namespace: jenkins
spec:
replicas: 1
template:
metadata:
labels:
app: jenkins
spec:
containers:
- name: jenkins
image: yourJenkinsImageBuildFromDockerfile
ports:
- containerPort: 8080
- containerPort: 50000
- containerPort: 4040
readinessProbe:
httpGet:
path: /login
port: 8080
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 2
failureThreshold: 5
resources:
limits:
cpu: 500m
memory: 1500Mi
requests:
cpu: 500m
memory: 1500Mi
Hi, your Dockerfile works when on Docker for Mac, but I can't get it to work against my Ubuntu 16.04 docker server (docker info
below).
$ docker run -ti -v /var/run/docker.sock:/var/run/docker.sock docker-jenkins bash
jenkins@5b4596d7f2ab:/$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/json: dial unix /var/run/docker.sock: connect: permission denied
Seems the problem is the group is docker
instead of staff
.
jenkins@5b4596d7f2ab:/$ ls -l /var/run/docker.sock
srw-rw---- 1 root docker 0 Mar 18 17:36 /var/run/docker.sock
jenkins@5b4596d7f2ab:/$ grep -E 'staff|docker|jenkins' /etc/group
staff:x:50:jenkins
jenkins:x:1000:
docker:x:999:
$ docker info
Containers: 48
Running: 37
Paused: 0
Stopped: 11
Images: 1146
Server Version: 17.03.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-31-generic
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 31.31 GiB
Name: 61
ID: YR2M:APBK:24BJ:3VVQ:IQ57:TYG2:FE5A:E7UQ:I337:O65O:BODC:GUJ5
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Labels:
provider=generic
Experimental: false
Insecure Registries:
192.168.2.61:5000
127.0.0.0/8
Live Restore Enabled: false
See moby/moby#31872 for a workaround.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.