Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-15505

Maven fabric8 plugin fails to run docker container in pipeline

      I am running a maven build that uses io.fabric8:docker-maven-plugin:0.23.0 to spawn docker containers for integration testing during mvn install. This works fine locally, but when executed with Bitbucket Pipelines, I get the following error:

      [INFO] DOCKER> Pulling from library/postgres
      #
      [INFO] DOCKER> Digest: sha256:d6150452877361e26d0fd178d278af8f80d59c75cbb5c2413cfb4fdb5ed4f750
      [INFO] DOCKER> Status: Downloaded newer image for postgres:10-alpine
      [INFO] DOCKER> Pulled postgres:10-alpine in 2 seconds 
      [ERROR] DOCKER> Error occurred during container startup, shutting down...
      [ERROR] DOCKER> I/O Error [Unable to create container for [postgres:10-alpine] : authorization denied by plugin pipelines: Command not supported. (Forbidden: 403)]
      

      So it seems that docker itself is working since the image is fetched successfully but when it comes to actually starting a container, the pipelines plugin forbids the operation.
      On the contrary, a literal docker run -d postgres:10 inside my pipeline step works.

        1. no-plugin
          18 kB
        2. plugin
          18 kB

            [BCLOUD-15505] Maven fabric8 plugin fails to run docker container in pipeline

            Attachment plugin has been added with description: Originally attached to Bitbucket issue #15505 in site/master

            Moritz Becker added a comment - Attachment plugin has been added with description: Originally attached to Bitbucket issue #15505 in site/master

            Attachment no-plugin has been added with description: Originally attached to Bitbucket issue #15505 in site/master

            Moritz Becker added a comment - Attachment no-plugin has been added with description: Originally attached to Bitbucket issue #15505 in site/master

            lassian added a comment -

            @4ntoine sorry the issue with testcontainers isnt the exact same one as this (I was just guessing it was at first as we have seen it happen with alot of docker clients) the issue with testcontainers is in how it is configuring mysql by default, you just need to update the default config for where the mysql-conf file is mounted from (hostPath) as described in BCLOUD-15844

            lassian added a comment - @4ntoine sorry the issue with testcontainers isnt the exact same one as this (I was just guessing it was at first as we have seen it happen with alot of docker clients) the issue with testcontainers is in how it is configuring mysql by default, you just need to update the default config for where the mysql-conf file is mounted from (hostPath) as described in BCLOUD-15844

            Moritz Becker added a comment - @4ntoine it looks like https://github.com/fabric8io/docker-maven-plugin/pull/956 is the one.

            4ntoine added a comment -

            I've created issue report for testcontainers:
            https://github.com/testcontainers/testcontainers-java/issues/700

            4ntoine added a comment - I've created issue report for testcontainers: https://github.com/testcontainers/testcontainers-java/issues/700

            4ntoine added a comment -

            @mobe1991

            I'm having similar issue with another library (testcontainers).
            So in fabric plugin you had this issue in 0.23 and it's gone in 0.25.2, right?
            Can you figure out related issues/commits?

            Are they:

            4ntoine added a comment - @mobe1991 I'm having similar issue with another library (testcontainers). So in fabric plugin you had this issue in 0.23 and it's gone in 0.25.2, right? Can you figure out related issues/commits? Are they: https://github.com/fabric8io/docker-maven-plugin/issues/946 https://github.com/fabric8io/docker-maven-plugin/issues/945\\ (by Nathan so that's it most likely. Since it's the issue is still open i wonder how it works in 0.25.2?) https://github.com/fabric8io/docker-maven-plugin/pull/956 (is it the fix for it actually?) https://github.com/fabric8io/docker-maven-plugin/issues/930

            Thank you for the update on this. I can confirm that everything works fine using version 0.25.2 of the fabric8 plugin. I am therefore resolving this issue.

            Moritz Becker added a comment - Thank you for the update on this. I can confirm that everything works fine using version 0.25.2 of the fabric8 plugin. I am therefore resolving this issue.

            The fabric8 plugin has been updated (e.g. version 0.25.2) to send the expected content-type header, and should now work fine.

            Kenny MacLeod added a comment - The fabric8 plugin has been updated (e.g. version 0.25.2) to send the expected content-type header, and should now work fine.

            The same issue is described here: https://community.atlassian.com/t5/Bitbucket-questions/create-container-authorization-denied-by-plugin-pipelines/qaq-p/731364

            using github docker-java client or testcontainers ends with the same problem. I could create the container only calling the api with a simple curl command or with a docker command

            Ricard Nàcher Roig added a comment - The same issue is described here: https://community.atlassian.com/t5/Bitbucket-questions/create-container-authorization-denied-by-plugin-pipelines/qaq-p/731364 using github docker-java client or testcontainers ends with the same problem. I could create the container only calling the api with a simple curl command or with a docker command

            From what I can tell, the same problem with the Spotify Docker Client, which is used in a lot of other libraries.

            Sander Verhagen added a comment - From what I can tell, the same problem with the Spotify Docker Client, which is used in a lot of other libraries.

              matt@atlassian.com Matt Ryall
              54ab56b1cb58 Moritz Becker
              Affected customers:
              3 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: