Questions tagged [docker-java]

Java API client for Docker

About

Java Docker API Client

Links

61 questions
0
votes
1 answer

How can I get the hostname of a container using docker-java?

I can create, start and retrieve an instance of a docker container like this: CreateContainerResponse response = dockerClient.createContainerCmd(imageId).exec(); String containerId =…
Rupert Madden-Abbott
  • 12,899
  • 14
  • 59
  • 74
0
votes
2 answers

List images in Google Container Registry in Java program

We wanted to list images and tags which names start with certain string. So far, we explored a few java lib (docker-java and spotify ones) and did quite amount of research, but still couldn't find a way out... docker-java: 'com.github.docker-java',…
0
votes
2 answers

Not able to start docker container with shell script

This is the start.sh script i am using: #!/bin/bash touch app.log HEAP_SIZE="-Xms1G -Xmx2G" GC_ARGS="-XX:+UseG1GC -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError" ARGS="$HEAP_SIZE $GC_ARGS" echo $ARGS echo $PWD nohup java $ARGS -jar…
user10916892
  • 825
  • 12
  • 33
0
votes
1 answer

docker-java run container with -rm flag

I am using docker-java to spawn new containers. I want to remove the containers after they are finished. Is there a way to achieve this with docker-java? So I basically want something like docker run --rm my-docker with docker-java.
0
votes
1 answer

How to check if an image is already present locally

I am using the docker-java Maven library, and I would like to know if there is a way to check if an image has already been pulled or is present locally before pulling it if necessary, with only the image name. Currently, I have to pull the image…
Ordinaly
  • 69
  • 1
  • 9
0
votes
2 answers

docker-java equivalent of "docker service create --with-registry-auth"

Using https://github.com/docker-java/docker-java and looking for a way to add the --with-registry-auth option from https://docs.docker.com/v17.12/engine/reference/commandline/service_create/#options val createCmd = dockerClient.createServiceCmd( …
TomGrill Games
  • 1,553
  • 2
  • 16
  • 25
0
votes
0 answers

Why am I getting "https://registry-1.docker.io/v2/{reponame}/tags/list: unauthorized: incorrect username or password"?

Summary I am trying to use the docker-java library but I am running into a problem when I try to pull an image. I am trying to pull from a private repository on ECR. What I have tried Much of the implementation I have been trying has come from the…
Daniel McC
  • 483
  • 4
  • 8
0
votes
1 answer

Docker: Publishing ports from a user-defined network to a specific host IP address with docker-java

I'm trying to achieve something similar to this: -p 192.168.1.100:8080:80 with docker-java. The only example that I found for publishing/mapping ports with docker-java is using the .withExposedPorts of the CreateContainerCmd class. here. I'm not…
nikitz
  • 1,051
  • 2
  • 12
  • 35
0
votes
2 answers

Disable IPv6 in Docker container from Java

I need to disable IPv6 when starting a Docker container from Java code. Using the command line, it is as follows: docker run --sysctl net.ipv6.conf.all.disable_ipv6=1 ... Is it possible to do the same but using Java with Spotify's docker-client? As…
Boni García
  • 4,618
  • 5
  • 28
  • 44
0
votes
1 answer

Unable to see Container Processes with docker-java

I'm using the docker-java libraries to handle start up of a Docker image: DockerClient dockerClient = DockerClientBuilder.getInstance("unix:///var/run/docker.sock").build(); CreateContainerResponse container =…
Francesco Marchioni
  • 4,091
  • 1
  • 25
  • 40
0
votes
0 answers

Does Arquillian Cube works with RestEasy

Arquillian Cube isn't working with RestEasy Implementations. I am getting error some things like below: Caused by: javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/vnd.docker.raw-stream…
Asarudeen A
  • 59
  • 1
  • 11
0
votes
0 answers

How to set classpath inside docker container on windows machine

i'm trying to create a docker image to run my java program inside the container. i new to docker i have no idea how to set the classpath. i have a datafile.properties, Sample.java,lib folder which contains all my dependancy jar files and my…
syndy1989
  • 403
  • 10
  • 25
0
votes
0 answers

docker container runtime application configurations

We have a java application. It connects to the oracle database. It has three properties files and the customer changes value of those properties files when we deployed our application to the customer site. We have another python script that allows…
Know Nothing
  • 1,121
  • 2
  • 10
  • 21
-1
votes
2 answers

Not able to access web app running inside docker container from local machine

I am using windows 10 enterprise version and i have tested docker hello world web app it works just fine. Dockerfile FROM adoptopenjdk/openjdk11:latest WORKDIR /app COPY ./ ./ EXPOSE 3000 CMD ["java", "-jar", "app.jar"] These are the steps i…
user10916892
  • 825
  • 12
  • 33
-1
votes
1 answer

docker-java: access containers on docker host

I am creating docker containers inside my java application (using docker-java). I want to make the containers (all from the same image) accessible for the host. Preferably all the containers listen on the same port, thus their IP address needs to…