【问题标题】:How can i solve a Jenkins error with docker-compose如何使用 docker-compose 解决 Jenkins 错误
【发布时间】:2020-07-28 21:52:11
【问题描述】:

我正在尝试使用 docker-compose 运行 jenkins

version: '3.5'
services:
  jenkins:
    build:
      context: .
      dockerfile: ./jenkins.Dockerfile
    volumes:
    - $PWD/jenkins_home:/var/jenkins_home
    - $PWD:/app
    ports:
      - 8080:8080  

但最终在尝试访问某些卷时出现此访问被拒绝错误。我无法在浏览器中打开 Localhost。

WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Starting 8fd02292a7fe_ejercicio_jenkins_1 ... 
Starting 8fd02292a7fe_ejercicio_jenkins_1 ... done
Attaching to 8fd02292a7fe_ejercicio_jenkins_1
8fd02292a7fe_ejercicio_jenkins_1 | Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
8fd02292a7fe_ejercicio_jenkins_1 | touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
8fd02292a7fe_ejercicio_jenkins_1 exited with code 1

我该如何解决这个问题?

【问题讨论】:

    标签: jenkins docker-compose continuous-integration devops continuous-deployment


    【解决方案1】:

    运行

    chmod 777 -R $PWD/jenkins_home
    

    【讨论】:

    • 这不包括关于它将做什么和安全隐患的警告,它不指示在哪里使用它(命令行,或作为 exec 的一部分插入到 docker-compose 中) ,运行时会发生什么,它将如何工作,为什么会工作,等等。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-22
    • 2021-10-13
    • 2017-05-03
    • 2021-11-24
    • 2019-03-26
    • 1970-01-01
    相关资源
    最近更新 更多