I'm having a Java unit test, which ultimately uses Spotify's Docker Client. It fails to create the Docker container on Bitbucket Pipelines, as follows:
msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/info
msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/version
msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri="/images/json?filters=%7B%22dangling%22%3A%5B%22false%22%5D%7D"
msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/images/create?fromImage=mdillon/postgis&tag=9.5-alpine"
msg="Pipelines plugin request authorization." allowed=false method=POST plugin=pipelines uri=/containers/create
msg="AuthZRequest for POST /containers/create returned error: authorization denied by plugin pipelines: Command not supported."
2018-01-24 22:35:09,458 WARN received SIGTERM indicating exit request
As this works fine on my local machine, I'm a little puzzled of what's so different about Pipelines?
I'm not mounting in any volumes, so I don't think it's this issue.
As it turns out, for this to work, I need to include the API version of the Docker server, i.e.:
DockerClient dockerClient = ...;
dockerClient.apiVersion = "1.29";
Not quite that simple (in the code), since DockerClient is immutable, but conceptually this was it.
I am trying to create a container for testing but I get the same error you reported. I added the version to the call too but it does not work. Could you please, add the call that works as you did below? just to compare the headers of the POST call
My call is as simple as
>> "POST /v1.29/containers/create HTTP/1.1[\r][\n]"
>> "Accept: application/json[\r][\n]"
>> "Content-Type: application/json[\r][\n]"
>> "User-Agent: Jersey/2.23.1 (Apache HttpClient 4.5)[\r][\n]"
>> "Transfer-Encoding: chunked[\r][\n]"
>> "Host: localhost:2375[\r][\n]"
>> "Connection: Keep-Alive[\r][\n]"
>> "Accept-Encoding: gzip,deflate[\r][\n]"
>> "[\r][\n]"
>> "81[\r][\n]"
>> "{"Image":"redis","Volumes":{},"ExposedPorts":{},"HostConfig":{"NetworkMode":"default","Privileged":false,"PublishAllPorts":true}}[\r][\n]"
>> "0[\r][\n]"
>> "[\r][\n]"
<< "HTTP/1.1 403 Forbidden[\r][\n]"
<< "Content-Type: application/json[\r][\n]"
<< "Date: Thu, 15 Feb 2018 10:42:44 GMT[\r][\n]"
<< "Content-Length: 79[\r][\n]"
<< "[\r][\n]"
<< "{"message":"authorization denied by plugin pipelines: Command not supported."}[\n]"
thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is Bitbucket still at 1.29? You can check with:
docker version --format "{{.Server.APIVersion}}
If Bitbucket were to be using a different (newer) API version, setting it to 1.29 would give you the same problem situation as originally.
This command is also what I use to parameterize the fix that I described, so that it's not hard-coded at 1.29:
export DOCKER_SERVER_API_VERSION="$(docker version --format "{{.Server.APIVersion}}")"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm again researching this, since very similar problems reappeared for us. Did you ever figure this out, @Ricard Nàcher Roig?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! I couldn't find any solution. Actually, I opened a question/issue with a very simple example at https://community.atlassian.com/t5/Bitbucket-questions/create-continer-authorization-denied-by-plugin-pipelines-Command/qaq-p/731364
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is more information:
>> "POST /containers/create HTTP/1.1[\r][\n]"
>> "Accept: application/json[\r][\n]"
>> "Content-Type: application/json[\r][\n]"
>> "User-Agent: Jersey/2.19 (Apache HttpClient 4.5.2)[\r][\n]"
>> "Transfer-Encoding: chunked[\r][\n]"
>> "Host: localhost:2375[\r][\n]"
>> "Connection: Keep-Alive[\r][\n]"
>> "Accept-Encoding: gzip,deflate[\r][\n]"
>> "[\r][\n]"
>> "ad[\r][\n]"
>> "{"Env":["POSTGRES_USER=test","POSTGRES_PASSWORD=test","POSTGRES_DB=test"],"Image":"mdillon/postgis:9.5-alpine","NetworkDisabled":false,"HostConfig":{"PublishAllPorts":true}}[\r][\n]"
>> "0[\r][\n]"
>> "[\r][\n]"
<< "HTTP/1.1 403 Forbidden[\r][\n]"
<< "Content-Type: application/json[\r][\n]"
<< "Date: Thu, 25 Jan 2018 02:10:45 GMT[\r][\n]"
<< "Content-Length: 79[\r][\n]"
<< "[\r][\n]"
<< "{"message":"authorization denied by plugin pipelines: Command not supported."}[\n]"
<< HTTP/1.1 403 Forbidden
<< Content-Type: application/json
<< Date: Thu, 25 Jan 2018 02:10:45 GMT
<< Content-Length: 79
Should I contact something else than "localhost", seems not?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Evidently this was not an answer, just an elaboration of the question, but please see my "accepted" answer for the real solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.