Questions tagged [docker-java]

Java API client for Docker

About

Java Docker API Client

Links

61 questions
78
votes
3 answers

How to make curl available in Docker image based java:8-jdk-alpine and keep the image clean?

We are having java code that runs curl command to fetch the some result. We have built a jar file and the jar file executes fine Now, when we try to dokerize the java program (using jar) and run the application in docker we get this…
user3356164
  • 783
  • 1
  • 5
  • 6
7
votes
2 answers

Testcontainer cannot configure port binding

I'm using testcontainer version 1.15.2. Tests are run in intellij on windows 10. I have a wiremock container. By default it listens on the port 8080. I would like to map this port to let's say 8081. So I do: public WiremockContainer() { …
7
votes
2 answers

Control docker-compose in Java

I created a fairly amount of docker-compose scripts which spawn up several services. I now want to control docker-compose in the JVM. Basically, I want to be able to execute up and down, ideally with -p parameter, so I can spawn…
Franz They
  • 945
  • 9
  • 17
5
votes
0 answers

TestContainers: reuse network from DockerComposeContainer to use in other GenericContainer?

There is a method: org.testcontainers.containers.GenericContainer#withNetwork which I can use to spawn containers with a same network using TestContainers lib. But what about DockerComposeContainer, first I start it, then I want to get a network out…
Nikolay Kuznetsov
  • 9,467
  • 12
  • 55
  • 101
5
votes
1 answer

Running Java command with Docker exec fails with "no such file or directory"

I'm using the Docker Java client in a Scala project to programmatically create images and start containers with volume(s), then when this is all done also execute a Java class within a jar file that is available in one of the attached volumes. //…
barney.balazs
  • 630
  • 7
  • 19
5
votes
4 answers

How To Create And Start Docker Container with specific port, detached mode using docker-java

I want to create and run docker using docker java client. I want running something like this : docker run -d -p 4444:4444 --name selenium-hub selenium/hub:2.53.0 How to implement this command on docker-java client? Here is my code so far…
Hendrione
  • 225
  • 1
  • 5
  • 18
4
votes
3 answers

How add setup before @SpringBootTest and only run once?

I have a docker DB setup method, which currently located in @BeforeAll. Currently, Construct as below @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) public DockerConstructorTest{ @BeforeAll public…
Neil
  • 2,714
  • 11
  • 29
  • 45
4
votes
1 answer

Testcontainers with a company proxy

Each start of different testcontainers will throw com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"Get https://quay.io/v1/_ping: dial tcp x.x.x.x: getsockopt: connection refused"} This is no surprise (docker is behind a…
ner0
  • 95
  • 3
  • 11
4
votes
3 answers

How to get the container Id of the running container using docker-java?

I am running a container with name tag which allows me to identify it.In docker-java,it requires container id for most of the operations and i do not know how to get that using docker-java.Can anyone help me how to get the container Id for the…
Raj Asapu
  • 436
  • 5
  • 11
4
votes
2 answers

Pulling image from Amazon ECR using docker-java

I am facing an issue with pulling image from Amazon ECR using docker-java client. The authentication of ECR registry login is successful, but unable to pull a specific image from the repository. Strange thing is that logging into ECR using bash and…
Lokesh A. R.
  • 2,326
  • 1
  • 24
  • 28
4
votes
3 answers

docker-java/docker remote api block until container is finished

I am trying to use the docker remote API from java using docker-java and I'm struggling to find a way to see when the execution of my container has finished: CreateContainerResponse container = dockerClient.createContainerCmd("me/vw:v0.1") …
XapaJIaMnu
  • 1,408
  • 3
  • 12
  • 28
3
votes
1 answer

Socket read interrupted during callback from Docker Java

Context I have a webservice writing a test id in a queue. Then, a listener reads the queue, searches the test and starts it. During those steps, it writes updates of the test in the database in order to be shown to the user. To be more precise: the…
Chavjoh
  • 466
  • 5
  • 13
3
votes
0 answers

How to get output of docker executed command in docker-java library

I am trying to pull an alpine image using docker-java library. Image got pulled successfully but I am not seeing any docker output on console. How to enable logging in docker-java library. public class DockerPull { public static void…
subham
  • 87
  • 7
3
votes
2 answers

How to get list of existing containers ids by Docker-java

In Java code I need to manage docker containers (restart, stop, start ...) using Docker-java library. https://github.com/docker-java/docker-java In Docker-Java examples I found the way to create and get…
Hans Pour
  • 432
  • 6
  • 15
3
votes
3 answers

Can't connect to Cassandra docker container in Scala Tests

I am quite desperately trying to set up docker tests in Scala. I have created an example project on GitHub to understand how should I set up the environment. It is available here: https://github.com/atais/sbt-scala-docker-cassandra I have selected…
Atais
  • 10,857
  • 6
  • 71
  • 111
1
2 3 4 5