[Linux] Build a jenkins environment with Docker

Introduction

Note how to build a jenkins environment with Docker

Environmental information

Docker environment construction

See article below [Linux] Docker environment construction on Redhat

docker-compose.yml settings

version: '3'

services:
  apache:
    build: apache
    container_name: apache
    ports:
      - 80:80
    volumes:
      - ./apache/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf
      - ./apache/conf/modules.conf:/usr/local/apache2/conf/modules.conf
      - ./apache/conf/proxy.conf:/usr/local/apache2/conf/proxy.conf
  jenkins:
    build: jenkins
    container_name: jenkins
    volumes:
      - ./jenkins/jenkins_home:/var/jenkins_home
    environment:
      - JENKINS_OPTS=--prefix=/Jenkins/ --sessionTimeout=1440
      - TZ=Asia/Tokyo
    privileged: true

Dockerfile settings

apache

FROM httpd:latest

RUN apt update \
    && apt install -y \
    git \
    gcc \
    make \
    build-essential \
    wget \
    curl \
    llvm \
    xz-utils \
    tk-dev \
    zlib1g-dev \
    libncurses5-dev \
    libbz2-dev \
    libreadline-dev \
    libsqlite3-dev \
    libssl-dev \
    libxml2-dev \
    libxmlsec1-dev \
    liblzma-dev \
    libpq-dev \
    libffi-dev

WORKDIR /usr/local/apache2

jenkins

FROM jenkins/jenkins:lts

WORKDIR /

USER root

RUN apt-get update \
    && apt-get install -y \
    gcc \
    g++ \
    expect \
    make \
    file \
    chromium \
    chromium-driver \
    libpq-dev \
    libssl-dev \
    libbz2-dev \
    libffi-dev \
    zlib1g-dev \
    liblzma-dev

WORKDIR /var/jenkins_home

EXPOSE 8080

Settings for various files

./apache/conf/httpd.conf

・ ・ ・
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so

Include conf/modules.conf <== added

・ ・ ・

IncludeOptional conf/proxy.conf <== added

./apache/conf/modules.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

./apache/conf/proxy.conf

# jenkins
<Location "/Jenkins">
   <IfModule proxy_module>
      ProxyPass http://jenkins:8080/Jenkins
      ProxyPassReverse http://jenkins:8080/Jenkins
   </IfModule>
</Location>

Jenkins startup confirmation

OK if you can access jenkins at the URL below

http://localhost/Jenkins

Recommended Posts

[Linux] Build a jenkins environment with Docker
[Linux] Build a Docker environment with Amazon Linux 2
[Python] Build a Django development environment with Docker
Build a CentOS Linux 8 environment with Docker and start Apache HTTP Server
Build a development environment with Poetry Django Docker Pycharm
Build a deb file with Docker
Build Mysql + Python environment with docker
Build PyPy execution environment with Docker
Build a Django development environment with Docker! (Docker-compose / Django / postgreSQL / nginx)
[Memo] Build a development environment for Django + Nuxt.js with Docker
[Django] Build a Django container (Docker) development environment quickly with PyCharm
Create a Todo app with Django ① Build an environment with Docker
Build a LAMP environment with Vagrant (Linux + Apache + MySQL + PHP)
Building a Python3 environment with Amazon Linux2
Easily build a development environment with Laragon
Build Jupyter Lab (Python) environment with Docker
Build a Tensorflow environment with Raspberry Pi [2020]
Build a Fast API environment with docker-compose
Get a local DynamoDB environment with Docker
Build a python virtual environment with pyenv
Build a modern Python environment with Neovim
Build NGINX + NGINX Unit + MySQL environment with Docker
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
Build a LAMP environment on your local Docker
Build a C language development environment with a container
Build Django + NGINX + PostgreSQL development environment with Docker
Go (Echo) Go Modules × Build development environment with Docker
Build a python environment with ansible on centos6
Build a Django environment with Vagrant in 5 minutes
[Memo] Build a virtual environment with Pyenv + anaconda
Build a Django development environment with Doker Toolbox
Build a Python environment with OSX El capitan
Quickly build a Python Django environment with IntelliJ
Build PyPy and Python execution environment with Docker
Build a mruby development environment for ESP32 (Linux)
Build a Python machine learning environment with a container
Build a python execution environment with VS Code
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]
Easy tox environment with Jenkins
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Trial and error]
[Linux] WSL2 Build an environment for laravel7 with Ubuntu 20.04
Build a LAMP environment [CentOS 7]
Build python3 environment with ubuntu 16.04
How to build a Django (python) environment on docker
Prepare python3 environment with Docker
Build python environment with direnv
[Go + Gin] I tried to build a Docker environment
Build a machine learning application development environment with Python
Build a machine learning environment
Build a Python environment offline
How to build a Python environment on amazon linux 2
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
Build a Django environment for Win10 (with virtual space)
Build a lightweight Fast API development environment using Docker
[Linux] Create a self-signed certificate with Docker and apache
Build a numerical calculation environment with pyenv and miniconda3
Build a basic Data Science environment (Jupyter, Python, R, Julia, standard library) with Docker.
Install LAMP on Amazon Linux 2 and build a WordPress environment.
Build a Docker environment that can use PyTorch and JupyterLab
Build a machine learning scikit-learn environment with VirtualBox and Ubuntu