简体   繁体   中英

How can i solve a Jenkins error with docker-compose

Im trying to run jenkins with docker-compose

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

but in the end appears this access denied error when it try to access to some volumes. I cannot open Localhost in my browser.

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

how can i solve this issue?

run

chmod 777 -R $PWD/jenkins_home

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM