Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
demo-infra-jenkins-agent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
demo
demo-infra-jenkins-agent
Commits
9afac5f6
Commit
9afac5f6
authored
Apr 25, 2020
by
Dave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docker instalation.
parent
980a4373
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
Dockerfile
Dockerfile
+24
-8
mvn-entrypoint.sh
mvn-entrypoint.sh
+0
-0
No files found.
Dockerfile
View file @
9afac5f6
FROM
jenkins/inbound-agent:4.3-4-jdk11
# install maven like https://github.com/carlossg/docker-maven/tree/master/openjdk-11
USER
root
# Install maven like in https://github.com/carlossg/docker-maven/tree/master/openjdk-11 .
ARG
MAVEN_VERSION=3.6.3
ARG
USER_HOME_DIR="/
root
"
ARG
USER_HOME_DIR="/
home/jenkins
"
ARG
SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
ARG
BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
RUN
mkdir
-p
/usr/share/maven /usr/share/maven/ref
\
&&
curl
-fsSL
-o
/tmp/apache-maven.tar.gz
${
BASE_URL
}
/apache-maven-
${
MAVEN_VERSION
}
-bin
.tar.gz
\
&&
echo
"
${
SHA
}
/tmp/apache-maven.tar.gz"
|
sha512sum
-c
-
\
&&
tar
-xzf
/tmp/apache-maven.tar.gz
-C
/usr/share/maven
--strip-components
=
1
\
&&
rm
-f
/tmp/apache-maven.tar.gz
\
&&
ln
-s
/usr/share/maven/bin/mvn /usr/bin/mvn
ENV
MAVEN_HOME /usr/share/maven
ENV
MAVEN_CONFIG "$USER_HOME_DIR/.m2"
COPY
mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
COPY
settings-docker.xml /usr/share/maven/ref/
# configure maven
COPY
settings-maven.xml ${MAVEN_CONFIG}/settings.xml
# Install Docker like in https://medium.com/@manav503/how-to-build-docker-images-inside-a-jenkins-container-d59944102f30 .
RUN
apt-get update
-qq
\
&&
apt-get
install
-qqy
apt-transport-https ca-certificates curl gnupg2 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
-qq
\
&&
apt-get
install
docker-ce
=
18.06.3~ce~3-0~debian
-y
RUN
usermod
-aG
docker jenkins
# Configure Maven.
RUN
chown
-R
jenkins:jenkins
${
MAVEN_CONFIG
}
USER
jenkins
# Configure Docker.
# Nothing to do.
ENTRYPOINT
["/usr/local/bin/mvn-entrypoint.sh"]
CMD
["mvn"]
\ No newline at end of file
CMD
["mvn"]
mvn-entrypoint.sh
100644 → 100755
View file @
9afac5f6
File mode changed from 100644 to 100755
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment