-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use a certain output as the input of docker exec...
#2306
Comments
I get the similar error when I want to use inputStream |
Since the default HTTP framework is not supported inputstream, you can use httpclient5 as the HTTP framework for Docker-Java. <dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>3.3.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.docker-java/docker-java-transport-httpclient5 -->
<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java-transport-httpclient5</artifactId>
<version>3.3.4</version>
</dependency> DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().build();
DockerHttpClient dockerHttpClient = new ApacheDockerHttpClient.Builder()
.dockerHost(config.getDockerHost())
.sslConfig(config.getSSLConfig())
.maxConnections(3000)
.build();
dockerClient = DockerClientBuilder.getInstance(config).withDockerHttpClient(dockerHttpClient).build(); |
ok, thank you, I will try it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to use docker-java to execute like
docker exec -i <containerId> java -cp /codeStore Main < ~/input.txt
,When I write
String[] cmd Args = new String[] { "java", "-cp", "/codeStore", "Main", "<", "~/input.txt"};
like this As a result, the program kept running and could not be stopped, so I useddockerClient.execStartCmd(execCreateCmdResponse.getId()).withStdIn(inputStream)
The writing method of
withStdIn(inputStream)
is used in , but the following error occurs;My requirement is to use a certain output as the input of
docker exec...
. I sincerely ask the author which API can do this.The text was updated successfully, but these errors were encountered: