ちょっとした提案と私はその答えも考えています。
Java用のドッカークライアントモジュールがある間に独自のコネクタを作成したいのはなぜですか?
<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>3.0.3</version>
</dependency>
と、さまざまな方法で設定します:
は、実行時にDockerClient programaticallyを作成したい:
DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
.withDockerHost("tcp://my-docker-host.tld:2376")
.withDockerTlsVerify(true)
.withDockerCertPath("/home/user/.docker/certs") // here is the place where your certificates are located
.withDockerConfig("/home/user/.docker")
.withApiVersion("1.23")
.withRegistryUrl("https://index.docker.io/v1/")
.withRegistryUsername("dockeruser")
.withRegistryPassword("ilovedocker")
.withRegistryEmail("[email protected]")
.build();
DockerClient docker = DockerClientBuilder.getInstance(config).build();
ところで、CertificateUtilsも定義されたパス内の証明書が存在するかどうかをチェックし、そこにドッキングウィンドウのための多くの優れた機能があり、それがすでにあります実装されました。
public static boolean verifyCertificatesExist(String dockerCertPath) {
String[] files = {"ca.pem", "cert.pem", "key.pem"};
boolean result = true;
for (String file : files) {
File path = new File(dockerCertPath, file);
result &= path.exists();
}
return result;
}
これは、あなたに役立つかもしれない:http://stackoverflow.com/questions/4146624/apache-httpclient-and-pem-certificate-files – zack6849
私はUIのテキストボックスにファイルの内容を指定します。私は接続を作成するために実行時にプログラムでそれらを取得します! –
私はそれが無関係にリンクされた答えをどのようにして見ていないのですか? – zack6849