Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
3j14 committed Jun 20, 2020
0 parents commit 4b5470e
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ARG AGENT_VERSION=4.3-4-jdk11
FROM jenkins/inbound-agent:$AGENT_VERSION

ARG version=1.0.0
LABEL Description="Inbound Jenkins Agent (JNLP) with Docker and Docker Compose" maintainer="jonas@drtlf.de" Version="$version"

ARG DOCKER_VERSION="5:19.03.11~3-0~debian-buster"
ARG DOCKER_COMPOSE_VERSION="1.26.0"

USER root

RUN apt-get update
RUN apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -

RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"

RUN apt-get update
RUN apt-get install -y docker-ce=$DOCKER_VERSION docker-ce-cli=$DOCKER_VERSION containerd.io

# Install Docker Compose
RUN curl -sL \
"https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose

RUN usermod -aG docker jenkins

USER jenkins
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2020 Jonas Drotleff. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.PHONY: build docker-version

IMAGE_NAME:=jenkins-jnlp-docker

build:
docker build -t ${IMAGE_NAME} .

docker-version:
docker run --entrypoint /usr/bin/apt-cache ${IMAGE_NAME} madison docker-ce
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Jenkins Agent with Docker and Docker Compose

![Docker Pulls](https://img.shields.io/docker/pulls/jonasdrotleff/jenkins-jnlp-docker)[https://hub.docker.com/r/jonasdrotleff/jenkins-jnlp-docker]

This image is based upon the Debian Buster JDK 11 version of
[`jenkins/inbound-agent`](https://hub.docker.com/r/jenkins/inbound-agent/)
and provides a Jenkins agent with Docker and Docker Compose preinstalled.

## Usage

**Linux**:
```bash
docker run --init jonasdrotleff/jenkins-jnlp-docker:latest -url <JENKINS_URL> <secret> <agent name>
```

Once your agent is connected with Jenkins, you can use the Docker Plugin
to build Dockerfiles, run commands in Containers, etc.

For more information about the JNLP agent, see
[jenkinsci/docker-inbound-agent](https://github.com/jenkinsci/docker-inbound-agent).

0 comments on commit 4b5470e

Please sign in to comment.