2017-02-01 7 views
3

고정 표시기 액세스 개체를 만들 수 없습니다,하지만 난 다음 오류가있어 테스트를 실행하려고하면내가 fabric8의 플러그인 스프링 통합 테스트를하고 싶은

Cannot create docker access object

내가 우분투를하고 나는 생각 잘 docker를 구성했는지, dockerfiles 또는 dockercompose에 아무런 문제가 없었으므로 사용 권한 문제이거나 뭔가 잊었을 수 있습니다.

내 fabric8 구성 아래로 지난이 테스트에는 mysql 이미지와 통합 테스트에 대한 maven-failsafe-plugin이 있습니다.

<!--maven plugin --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-failsafe-plugin</artifactId> 
      <executions> 
       <execution> 
        <goals> 
         <goal>integration-test</goal> 
         <goal>verify</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <environmentVariables> 
        <it-database.port>${it-database.port}</it-database.port> 
       </environmentVariables> 
      </configuration> 
     </plugin> 
     <!--fabric8 plugin --> 
     <plugin> 
      <groupId>io.fabric8</groupId> 
      <artifactId>docker-maven-plugin</artifactId> 
      <version>0.18.1</version> 
      <configuration> 
       <!--<dockerHost>unix:///var/run/docker.sock</dockerHost>--> 
       <dockerHost>tcp://0.0.0.0:2375</dockerHost> 
      </configuration> 
      <executions> 
       <execution> 
        <id>prepare-it-database</id> 
        <phase>pre-integration-test</phase> 
        <goals> 
         <goal>start</goal> 
        </goals> 
        <configuration> 
         <images> 
          <image> 
           <name>mysql:5.7</name> 
           <alias>it-database</alias> 
           <run> 
            <ports> 
             <port>it-database.port:5432</port> 
            </ports> 
            <wait> 
             <log>database system is ready to accept connections</log> 
             <time>20000</time> 
            </wait> 
           </run> 
          </image> 
         </images> 
        </configuration> 
       </execution> 
       <execution> 
        <id>remove-it-database</id> 
        <phase>post-integration-test</phase> 
        <goals> 
         <goal>stop</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

답변

1

docker 데몬이 포트 2375에서 수신 대기합니까? pom.xml에서 0.0.0.0 대신 localhost 또는 127.0.0.1을 시도 할 수 있습니다.

당신은

env | grep DOCKER 

그것은 나쁜 환경 변수도

수 입력 할 수 있습니다