Dockerfile:
FROM arm32v7/ubuntu:18.04
RUN apt-get update && apt-get install -y wget openjdk-11-jre-headless
RUN mkdir app
WORKDIR /app
RUN wget https://get.jenkins.io/war-stable/2.277.1/jenkins.war
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
ARG http_port=8080
ARG agent_port=50000
ENV JENKINS_HOME /var/jenkins_home
ENV JENKINS_SLAVE_AGENT_PORT ${agent_port}
RUN groupadd -g ${gid} ${group} && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user}
USER jenkins
CMD ["java","-jar", "/app/jenkins.war"]
Build:
docker build -t janenkins .
Run:
pi@raspberrypi:~ $ docker run -d -p 8889:8080 -p 50000:50000 -v /yourdir/on/server:/var/jenkins_home janenkins
Running containers:
docker ps
CONTAINER ID .....
d3c9ef3c569c .....
.......
Shell for Running Docker Container:
docker exec -it d3c9ef3c569c /bin/bash