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:

  • Running Docker Image
  • Can't resolve hostnames between docker containers
  • Docker client force Monolithic Upload
  • Add docker container to network under two different names
  • Write to a file on docker container gives error: No such file or directory
  • want to use the same host and port for ssh session
  • 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

  • Docker. Does restart container means the same as restart process from CMD instruction?
  • Having trouble getting docker to work on mac
  • How to launch docker image with --entrypoint and arguments?
  • Redirect users to different domains of the same web application according to their ip address location
  • Run a database migration command when deploying a Docker container to AWS
  • Docker-Compose v3 & NGINX network issue
  • 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.