Questions tagged [docker-java]

Java API client for Docker

About

Java Docker API Client

Links

61 questions
1
vote
0 answers

how to start docker container with detach for docker-java?

I am trying to run a docker image using the following code. But the container is exiting immediately after starting. I don't find -d params at creating container. how to do? HostConfig hostConfig = new HostConfig(); DefaultDockerClientConfig.Builder…
xue xue
  • 11
  • 2
1
vote
1 answer

can't create a docker image with java. Error msg is "......: Error processing tar file(exit status 1): unexpected EOF"

I use Java to build a Docker image. The Dockerfile and code are ready. I can build an image successfully through CLI, such as: docker build -t imgetest:1.0 . My Dockerfile is: FROM node:6.14.2 EXPOSE 8080 COPY server.js . CMD [ "node", "server.js"…
taichi_tiger
  • 809
  • 1
  • 7
  • 18
1
vote
2 answers

How to find CPU MEMORY usage with docker stats command?

I am using docker-java API to execute docker API in my project. I didn't find any suitable method which lists down docker CPU memory usage as GET /v1.24/containers/redis1/stats HTTP/1.1 with the help of docker-java API Dependency compile group:…
UDIT JOSHI
  • 1,298
  • 12
  • 26
1
vote
0 answers

MSSQL DB Instance connection issue through SQLCMD when using inside a docker container

I am trying to write java code to automate the docker commands that I execute. I am actually creating a mssql docker container and then want to restore a DB backup in that container. I am able to achieve this using docker commands but having trouble…
Edward
  • 11
  • 1
1
vote
0 answers

Starting mariaDB container and start-up script with Docker

I'm creating a mariaDB container via docker run with -v pathToSQL:/docker-entrypoint-initdb.d/script.sql option via Java. I have no idea how to find out when the container is ready to be connected with my JDBC client. How can I find out when the…
ogarogar
  • 323
  • 2
  • 14
1
vote
2 answers

Unable to run java Program. Error inside docker

I am just a beginner to Docker and was exploring the various features. I have successfully installed java inside docker **OS version**:Windows Server 2016 PS C:\testing> docker version Client: Version: 17.03.1-ee-3 API version: 1.27 Go…
1
vote
1 answer

Groovy does not executes Java-Method (signature includes generics)

i have the following Java-Code that i want to convert to groovy: String containerId = "545cdc81a969"; ExecCreateCmdResponse execCreateCmdResponse = dockerClient .execCreateCmd(containerId) .withAttachStdout(true) .withCmd("sh", "-c",…
marbon
  • 21
  • 5
0
votes
1 answer

ocrmypdf not working when using the docker image and the docker java client over a binding volume

When running an ocrmypdf docker container, all I get is the following message: ocrmypdf: error: unrecognized arguments: 64ee37a6fc66cf591ce4a35f-1.png_OCR.pdf This is what my docker inspect container shows: "Args": [ "ocrmypdf", …
Luis Lavieri
  • 4,064
  • 6
  • 39
  • 69
0
votes
1 answer

java.lang.NoClassDefFoundError: com/github/dockerjava/api/command/LoadImageAsyncCmd

I am trying to create a Docker client with the Docker Java API, but I get a ClassNotFoundException when running my code. I am following this Baeldung guide, but I am using the latest version of docker-java-api (version 3.3.3). Maven…
Anzu67
  • 23
  • 6
0
votes
1 answer

Is it possible to execute custom commands with the Docker Java API?

Can the Docker Java client library (https://github.com/docker-java/docker-java) be used to execute custom commands? I want to use the library to check if Docker images I need to download are compatible with multiple architectures (specifically,…
0
votes
1 answer

Use CMD parameters in distroless image

I am using azul/zulu-openjdk-distroless:17.0.6 image and want to execute the java command with parameters but it fails at the runtime Here is my docker image: FROM alpine:3.17.3 as build-env ARG DATADOG_VERSION=1.8.3 RUN wget…
Sunflame
  • 2,993
  • 4
  • 24
  • 48
0
votes
1 answer

Running Docker command in java

I'm trying to run this command in docker trough java, but i don't know why it only works when i execute the command in the host machine and not trough java (when execute on java it doesn't add or say nothing). i'm 99% sure problem are the ">>" of…
R3bck
  • 43
  • 5
0
votes
1 answer

docker-Java stop timeout

i'm using the java-docker client from here: https://github.com/docker-java/docker-java. I trying to figure out how to set the stop timeout for the docker stop command. So i'm using in java the method…
codenewbie
  • 61
  • 7
0
votes
0 answers

Docker: different java versions in interactive and non-interactive modes

Here is my Dockerfile FROM ubuntu:20.04 # Install java 8 with apt-get RUN apt-get update -qq && apt-get install -yqq openjdk-8-jdk # Install java 11 with sdkman RUN apt-get install -yqq curl unzip zip RUN curl -s "https://get.sdkman.io" | bash RUN…
Zarki
  • 1
0
votes
1 answer

About the withCmd command of docker-java

I want to ask how I use the withCmd method as follows: commands = new String[]{"echo","test:111 | chpasswd"}; ExecCreateCmdResponse execCreateCmdResponse = dockerClient.execCreateCmd("b6b571d5469a") …
yang
  • 1
  • 1