Giter Club home page Giter Club logo

dcos-jenkins-dind-agent's Introduction

Repository Moved

  • This repository has moved as a sub-directory within the dcos-jenkins-service repository.
  • The current repository will be archived, but can be forked and modified as necessary. All released images remain unchanged.

Jenkins Docker-in-Docker Agent

Docker Stars Docker Pulls

A simple Docker image for running a Jenkins agent alongside its very own Docker daemon. This is useful if you're trying to run Jenkins agents on a Mesos cluster, and you also want to build and push Docker images using your CI system.

For full documentation on how to use this Docker image, please refer to https://docs.mesosphere.com/services/jenkins/custom-docker/.

Usage

Command line

Try it out locally by running the following command:

docker run --privileged mesosphere/jenkins-dind:0.5.0-alpine \
  wrapper.sh "java -version && docker run hello-world"

Jenkins

You'll need to configure the Mesos plugin on your Jenkins master to use this image. You'll probably also want to give it a special slave label, so that you don't unnecessarily run builds using the dind image. A relevant snippet of the Mesos plugin within the Jenkins master's config.xml follows:

<org.jenkinsci.plugins.mesos.MesosSlaveInfo>
  <slaveCpus>0.1</slaveCpus>
  <slaveMem>512</slaveMem>
  <executorCpus>0.1</executorCpus>
  <maxExecutors>2</maxExecutors>
  <executorMem>128</executorMem>
  <remoteFSRoot>jenkins</remoteFSRoot>
  <idleTerminationMinutes>3</idleTerminationMinutes>
  <jvmArgs>
    -Xms16m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true
  </jvmArgs>
  <jnlpArgs/>
  <containerInfo>
    <type>DOCKER</type>
    <dockerImage>mesosphere/jenkins-dind:0.6.0-alpine</dockerImage>
    <networking>BRIDGE</networking>
    <useCustomDockerCommandShell>true</useCustomDockerCommandShell>
    <customDockerCommandShell>wrapper.sh</customDockerCommandShell>
    <dockerPrivilegedMode>true</dockerPrivilegedMode>
    <dockerForcePullImage>false</dockerForcePullImage>
  </containerInfo>
  <mode>NORMAL</mode>
  <labelString>dind</labelString>
</org.jenkinsci.plugins.mesos.MesosSlaveInfo>

dcos-jenkins-dind-agent's People

Contributors

bryanlatten avatar colin-msphere avatar jdef avatar jeremykuhnash avatar kaiwalyajoshi avatar mikestaub avatar milenkovicm avatar nickbp avatar sschneid avatar ssk2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dcos-jenkins-dind-agent's Issues

[Docker 17.12.1 (dind) Jenkins-dind:0.7.0-alpine] ERROR: Error installing domain_name or unf or unf_ext

ERROR:

ERROR:  Error installing domain_name:
   ERROR: Failed to build gem native extension.

   current directory: /root/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
/root/.rbenv/versions/2.4.1/bin/ruby -I /root/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0 -r ./siteconf20190212-5-1m4kee2.rb extconf.rb
checking for -lstdc++... yes

(Refer)[https://github.com/gliderlabs/docker-alpine/issues/261]'

Regenerate:

FROM mesosphere/jenkins-dind:0.7.0-alpine
USER root
# install necessary packages
RUN apk update && \
     apk add bash ca-certificates curl git build-base perl \
     libffi-dev bash zlib-dev linux-headers readline \
     gmp-dev gdbm-dev db-dev libressl-dev coreutils \
     readline-dev wget jq terraform mysql-client autoconf yaml-dev
# set env vars
ENV RBENV_ROOT /root/.rbenv
ENV PATH ${RBENV_ROOT}/shims:${RBENV_ROOT}/bin:$PATH
ENV RUBY_VERSIONS '2.4.1'
ENV RUBYGEMS_VERSION 3.0.2
# Set timezone for Jenkins Slave
ENV JENKINS_JAVA_OPTIONS="-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/Chicago -Duser.timezone=America/Chicago"
# install rbenv and ruby-build
RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT}
RUN git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build
RUN sh ${RBENV_ROOT}/plugins/ruby-build/install.sh
# install rubies and set global version
RUN echo 'eval "$(${RBENV_ROOT}/bin/rbenv init -)"' >> /etc/profile
RUN source /etc/profile
RUN for version in $RUBY_VERSIONS; do rbenv install "$version"; done
RUN rbenv global $RUBY_VERSIONS
RUN ${RBENV_ROOT}/shims/gem update --system ${RUBYGEMS_VERSION}
RUN ${RBENV_ROOT}/shims/gem install --no-document --force io-console unf json rake bundler

DIND agent behind corporate proxy

All,
My DCOS is running behind a corporate proxy and is configured for proxy.
The docker is running with proxy setup on each agent and can pull image from internal repository.
The slave docker jenkins started is not getting accessed to the internet to build anything.

Is there anyway the slave can inherit from the setting of the master?

Step to reproduce on any agent
sudo docker run hello-world => that works
sudo docker run --privileged mesosphere/jenkins-dind:0.3.1 wrapper.sh "docker run hello-world" => That will crash with error Get https://index.docker.io/v1/repositories/library/hello-world/images: x509: certificate is valid for FG3K6C3A13800607, not index.docker.io.

Antoine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.