Can't attach volume to docker with jenkins through fig

I try setup sonarqube and jenkins through one fig config. But can’t attach volume to docker with jenkins through. Can somebody help?

In this way container run correctly:

  • Docker log (driver json-file) location for Docker for windows
  • Flask Rest API based on docker - Graceful shutdown
  • Docker giving IP address at the same level as the host, similar to VM bridged networking
  • Why my docker exit after excute my shell script? [duplicate]
  • DC/OS packages not exist
  • Cannot restart the MySQL Docker container, gives errors like `Can't open the mysql.plugin table` and `Table 'mysql.user' doesn't exist`
  • docker run -p 8080:8080 -v /opt/jenkins_home:/var/jenkins_home shami13fastpool/fastpool-jenkins
    

    fig.yml:

    postgresql:
      image: orchardup/postgresql:latest
      environment:
        - POSTGRESQL_USER=sonar
        - POSTGRESQL_PASS=sonar
        - POSTGRESQL_DB=sonar
      volumes:
        - /opt/db/sonarqube/:/var/lib/postgresql
      ports:
        - "5432:5432"
    sonarqube:
      image: harbur/sonarqube:latest
      links:
        - postgresql:db
      environment:
        - DB_USER=sonar
        - DB_PASS=sonar
        - DB_NAME=sonar
      ports:
        - "9000:9000"
        - "443"
    jenkins:
      image: shami13fastpool/fastpool-jenkins:latest
      volumes:
        - /opt/jenkins_home/:/var/jenkins_home/:rw
      links:
        - postgresql:db
        - sonarqube:sonarqube
     ports:
        - "8080:8080"
    

    This both commands must run the same instance of jenkins, but i’ve got different instances

  • Difference between Docker and OpenVZ
  • How to wait for an etcd variable is set before starting the unit/service
  • Cannot locate specified Dockerfile
  • how does docker treat child process when we send stop to pid 1
  • Pattern for Bridging Containers -> Kubernetes deployments
  • Segmentation Fault (core dumped) while running phpunit
  • One Solution collect form web for “Can't attach volume to docker with jenkins through fig”

    In your fig.yml file, you’re linking to postgres and sonarqube, but you’re not doing any linking in your Docker command.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.