This commit is contained in:
InsanusMokrassar 2020-06-05 00:56:10 +06:00
commit af9e6d9e4b
3 changed files with 42 additions and 0 deletions

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM ubuntu:18.04
USER root
RUN apt update && apt -y install wget gnupg2 openjdk-8-jdk zip unzip curl sudo git
RUN mkdir -p /var/jenkins_home/jenkins && cd /var/jenkins_home/ &&\
wget http://mirrors.jenkins.io/war-stable/2.222.4/jenkins.war &&\
chown 1000:1000 jenkins.war
RUN useradd -s /bin/bash -G sudo -d /var/jenkins_home -u 1000 jenkins && chown -R jenkins:jenkins /var/jenkins_home &&\
chmod 777 /tmp
VOLUME /var/jenkins_home/jenkins
RUN chown -R 1000:1000 /var/jenkins_home
USER 1000
ENTRYPOINT /var/jenkins_home/run

17
deploy Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
function assert_success() {
"${@}"
local status=${?}
if [ ${status} -ne 0 ]; then
echo "### Error ${status} at: ${BASH_LINENO[*]} ###"
exit ${status}
fi
}
version="2.222.4"
assert_success docker build -t jenkins:$version ./
assert_success docker tag jenkins:$version insanusmokrassar/jenkins:$version
assert_success docker tag jenkins:$version insanusmokrassar/jenkins:latest
assert_success docker push insanusmokrassar/jenkins

5
run Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
export JENKINS_HOME="$HOME/jenkins"
java -jar ~/jenkins.war