Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jenkins 설치 및 실행 with Docker-compose

...

Jenkins Pipeline Overview

Jenkins 설치 with Docker

  • https://github.com/Sanses/devops_06_03_jenkins/blob/master/src/jenkins_remote_docker/Dockerfile
    Image Added

    Code Block
    titleDockerfile
    FROM jenkins/jenkins:lts
    ARG DOCKER_GID=1000
    USER root
    
    # docker install
    COPY scripts/install_docker.sh /install_docker.sh
    RUN chmod +x /install_docker.sh && \
        /install_docker.sh
    
    # aws cli install
    COPY scripts/install_aws.sh /install_aws.sh
    RUN chmod +x /install_aws.sh && \
        /install_aws.sh
    
    # set jenkins user to host docker group
    RUN /usr/sbin/groupadd -g ${DOCKER_GID:-1000} -f docker && \
        /usr/sbin/usermod -aG docker jenkins
    
    USER jenkins
    Code Block
    titledocker-compose.yml
    version: '3.8'
    services:
      jenkins:
        build:
          context: ""
          args:
            DOCKER_GID: ${DOCKER_GID}
        container_name: jenkins
        environment:
          TZ: "Asia/Seoul"
          JAVA_OPTS: "-Dhudson.model.DownloadService.noSignatureCheck=true"
          DOCKER_GID: ${DOCKER_GID}
        ports:
          - "8080:8080"
        volumes:
          - "./data:/var/jenkins_home"
          - "/var/run/docker.sock:/var/run/docker.sock"