user3322664
user3322664

Reputation:

Cannot create docker access object

I would like have spring integration test with the plugin of fabric8, but when I try to run the test I got the next error:

Cannot create docker access object

I have ubuntu and I think that I have well configurated dockers, I haven't had any problems with dockerfiles or dockercompose, so may it will be either a permissions problems or I forgot something.

I past below my fabric8 configuration, this have an image of mysql and the maven-failsafe-plugin to integration test.

<!--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>

Upvotes: 9

Views: 16610

Answers (6)

S. H.
S. H.

Reputation: 90

I experience the same issue with a non elevated user (Docker installed as Admin and privileged mode/user added to Group), only occurs when I use the Maeven daemon and try to run multithreaded when I run sequential this does not occur at all for me. So it seems when a process already uses the access currently it is blocked from additional access, so accessing it multiple times at the same time is not possible. I tried out almost every Docker setting on the Docker for Windows but it is not working so I use normal mvn for my Dockers and build only the modules parallel.

Upvotes: 0

Ahmed Youssef
Ahmed Youssef

Reputation: 123

had same problem on m1 one and the following docker setting solve my problem enter image description here

Upvotes: 0

Pracheer Pancholi
Pracheer Pancholi

Reputation: 600

If you are running docker desktop on windows 10 then we don't need docker host as its required only when using Docker Toolbox (Windows) for the older version of windows and in that we can use docker-machine ip to find out docker host...

Upvotes: 0

Rafa S.R.
Rafa S.R.

Reputation: 48

Most likely your desktop configuration is requiring superuser privileges for running docker commands. You should either run your maven build with "sudo" or configure your docker environment in order to not need such privileges.

Upvotes: 1

Christian
Christian

Reputation: 162

A bit late but try to restart Docker. I had the same issue and restarting docker resolved the Problem.

Docker Desktop on Windows 10

Upvotes: 4

James Strachan
James Strachan

Reputation: 9198

Are you sure the docker daemon is listening on port 2375? You may want to try localhost or 127.0.0.1 instead of 0.0.0.0 in the pom.xml.

Could you type

   env | grep DOCKER

It could be a bad environment variable too

Upvotes: 1

Related Questions