-
Notifications
You must be signed in to change notification settings - Fork 550
Invalid RSA private key when using Docker client with maven dockerfile:build with Docker Data Center 17.06 #887
Comments
I have also this problem. Docker Client should support EC private key |
I have the same problem. My docker server version is ucp/2.2.3. The private key (key.pem) in ucpbundle is EC private key. Further investigation on docker-client source code shows, that in class com.spotify.docker.client. DockerCertificates#generatePrivateKey(PrivateKeyInfo privateKeyInfo) there is hard coded expectation, that the private key must be RSA private key. I don’t know if it possible to change docker datacenter configuration to use RSA private key. Unfortunately the it support in our company have no idea how to do this. And I think, the docker-client should support both types (EC and RSA) of private keys. |
I fix this creating a class MyDockerCertificates that implements DockerCertificatesStore
|
@marcomsousa can you please put the class on git |
@soufianetomase PR #1007 seems to resolve the issue. |
@marcomsousa, can you please advise if you have added the file with fix to your project codebase or was this pushed into Spotify plugin code? Appreciate your help! |
Description
I have created my client bundle in Docker Data Center which consists of these files:
Where
key.pem
is an "EC PRIVATE KEY".When I load client bundle (via
source ./env.sh
) the environment variables are set correctly:This means, I can run commands like
docker info, docker ps, docker build,
etc. without any problems on the remote Docker cluster.However when I use dockerfile-maven-plugin to build a Docker image on the remote Docker cluster, I get an "Invalid RAS private key" error message.
How to reproduce
source ./env.sh
My plugin configuration in Maven is straight-forward:
mvn dockerfile:build
What do you expect
Docker images should be built on the remote Docker cluster successfully.
What happened instead
I get these error messages from conc. "Invalid RSA private key" (see full-strack trace below):
It somehow cannot find my Docker certificates and/or it seems to be that there is an invalid RSA private key having a version not being 0?
I also read this post and I converted the EC key to a PKCS#8 private key using these commands
But unfortunately, that still doesn't help - I get the very same error messages.
Software:
docker version
:Docker Data Center 17.06:
1.3.5
According to here, dockerfile plugin 1.3.5 uses Docker client 8.8.1
Full backtrace
The text was updated successfully, but these errors were encountered: