Questions tagged [docker-java]

Java API client for Docker

About

Java Docker API Client

Links

61 questions
3
votes
3 answers

How to play a docker run --rm with docker-java?

In our J2EE project, we want to call sjourdan/ffmpeg docker through the docker-java library. A typical call for ffmpeg conversion will be something like: docker run --rm -v /e/data:/tmp/workdir sjourdan/ffmpeg -i /tmp/workdir/test.mov -f mp4 -vcodec…
Xavier Portebois
  • 3,354
  • 6
  • 33
  • 53
3
votes
2 answers

How to wait a ResultCallback from DockerClient.waitContainerCmd()?

In our J2EE project, we're doing some video conversion by calling sjourdan/ffmpeg docker from our java code, relying on docker-java. For now, it looks something like this (quite simplified for brevity): CreateContainerCmd createCommand =…
Xavier Portebois
  • 3,354
  • 6
  • 33
  • 53
2
votes
1 answer

How can I parse an existing docker container into testcontainers?

I have an existing PostGres docker container running in the background. Is it possible to create a GenericContainer that will parse the existing PostGres container by taking in the container ID, instead of creating a completely new container?
Ajay
  • 21
  • 2
2
votes
2 answers

Testcontainers with sftp image throws Error on "nc not found" or "Address Not Available"

I have this very simple code for running my integration test: (using Testcontainer artifact version 1.16.2) Note: I have tested whether this port in test is available before running the test case. @Testcontainers public class SftpServerTestContainer…
tepetrol
  • 94
  • 8
2
votes
1 answer

Docker Binding parse exception with testcontainers

I would like to run some integrational tests which would include setting up a complete environment with org.testcontainers Docker Compose Module. I am new to Windows and Docker testing, same with the testcontainers. Using versions: Docker desktop…
Five
  • 378
  • 2
  • 19
2
votes
0 answers

How can I log docker-java operations to the console?

I'm using the docker-java library in a command-line project, doing things like this: private DockerClient client; public Docker() { var config = DefaultDockerClientConfig .createDefaultConfigBuilder() …
Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
2
votes
2 answers

How to run a docker container from within java

I want to run the following command from within a Java Eclipse Project: docker container run -p 4000:5000 virtuprint:vp where virtuprint:vp is an image. I installed the docker-java api from here https://github.com/docker-java/docker-java using all…
Flontis
  • 307
  • 1
  • 4
  • 13
2
votes
2 answers

How to get the docker host URI on my localhost

Is there a command that I can evaluate (eval $COMMAND) or an environment variable that I can inspect to get the URI of the locally running docker host? I need to be this an expression to evaluate at runtime, since I need to use it in a script…
Marco R.
  • 2,667
  • 15
  • 33
2
votes
2 answers

Docker-Java: Starting container with arguments

I'm trying to start a docker container using docker-java. Using the method DockerClient.startContainerCmd works for me, but I need to start the container with arguments. The StartContainerCmd class that is returned from this method does not have any…
Idov
  • 5,006
  • 17
  • 69
  • 106
2
votes
1 answer

Errors with notification endpoint for local docker registry

I have successfully deployed a local docker registry and implemented an listener endpoint to receive event notifications following the documentation for configuration using a sample insecure configuration file. Pushing, pulling and listing images…
SyCode
  • 1,077
  • 4
  • 22
  • 33
2
votes
1 answer

Windows Server 2016 OpenJDK docker container

I'am running docker on windows server 2016, when I try to build an image with a Dockerfile that contains this text: FROM openjdk:8-jdk-alpine ADD target/eureka-server-one.jar app.jar EXPOSE 8761 ENTRYPOINT…
2
votes
2 answers

How can I Get command exit code executed with Testcontainers?

Using GenericContainer#execInContainer I can only get stdout or stderr. Is there any way to get exit code of executed command? I can't rely on the presence of text in stderr. The application I execute prints some info to stderr but exits with code…
Kirill
  • 6,762
  • 4
  • 51
  • 81
2
votes
0 answers

Could not push image: denied: requested access to the resource is denied

I'm using docker-java to create an image on a docker host which is running on a Ubuntu 16.04 VM. The image creation works just fine and I can list the image created via docker-java. But when I try to push the image to a private registry(Harbor) I…
Vivek Shankar
  • 770
  • 1
  • 15
  • 37
1
vote
1 answer

Accessing the output of a command running in a docker container

I'm trying to upgrade from docker-java 0.10.3 to 3.2.7. This line has me completely stumped: InputStream response = dockerClient.attachContainerCmd(container.getId()) .withLogs(true) .withStdErr(true) .withStdOut(true) …
Matthew Taylor
  • 13,365
  • 3
  • 17
  • 44
1
vote
1 answer

Get Docker Image Name when loading image to docker using docker-java lib

I am trying to load image to docker from tar file and verify if the tar file is valid or not. Now if tar file is valid I need to get the imageName and tag. But I checked and the return type for exec method is void. Does anyone know how can I get the…
Vipin Gupta
  • 213
  • 3
  • 15