Install Jenkins (docker based)


💡 How to install Jenkins based on docker.

Test environment

  • Ubuntu 18.04
  • docker 18.09.1

Install

Create host <-> container permanent volume

$ mkdir -p /app/jenkins
$ chmod 777 /app/jenkins

Run Jenkins

$ docker run -d --name jenkins -p 8080:8080 -p 50000:50000 -v /app/jenkins:/var/jenkins_home \
  -u root -e JAVA_OPTS='-Duser.timezone=Asia/Seoul -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8' leechungkyu/jenkins

Continue installation from web browser

🌍 http://<ip>:8080 connecting, and continue the installation.

Input password

/var/jenkins_home/secrets/initialAdminPassword

$ docker exec -it jenkins /bin/bash
$ cat /var/jenkins_home/secrets/initialAdminPassword
3830de413f4d49f7963223507527f02a # password

Plugin installation

Install by default and wait for the ProgressBar to complete.

Create admin account

Enter your account name (login ID), password, name, and email address.

Jenkins URL Setting

Start Jenkins

Note

$ cat Dockerfile
... Skip

# Set the locale ko_KR.UTF-8
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# ko_KR.UTF-8 UTF-8/ko_KR.UTF-8 UTF-8/' /etc/locale.gen && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    update-locale LANG=ko_KR.UTF-8

ENV LANG ko_KR.UTF-8
RUN locale-gen ko_KR.UTF-8
ENV LANG ko_KR.UTF-8
ENV LANGUAGE ko_KR.UTF-8
ENV LC_ALL ko_KR.UTF-8

# Set TimeZone Seoul
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

... Skip