Questions tagged [docker-api]

Use this tag with the Docker Engine API.

Docker runs as a client-server accepting request via the Docker Engine API.

Image

189 questions
1
vote
1 answer

How to build an Image using Docker API?

I am trying to build a docker Image using the APIs mentioned in the official link. But I am unable to get what the document says: Example request: POST /v1.24/build HTTP/1.1 {{ TAR STREAM }} There are few things which are confusing me, 1) Where…
Here_2_learn
  • 5,013
  • 15
  • 50
  • 68
1
vote
1 answer

Docker API - how do I join a network?

this is the documentation for the API: https://docs.docker.com/engine/api/v1.24/#containers where you'll see that for the create container method a section of the JSON labelled "NetworkingConfig" is displayed this section is not described at all and…
ekkis
  • 9,804
  • 13
  • 55
  • 105
1
vote
2 answers

Docker Update Secrets via API

Is there an equivalent to docker service update --secret-add [SOME SECRET] [SERVICE]? The docs don't mention anywhere I can do this: https://docs.docker.com/engine/api/v1.25/#tag/Service but I've been told before that the docker command uses the…
Afraz
  • 795
  • 1
  • 6
  • 20
1
vote
1 answer

docker swarm service how to specify a delay time in restart policy?

I am create a docker swarm service, If one of the container stops in a service it will immediately schedule docker container in one of available swarm nodes, I want to delay that schedule for 5 second am using docker API. in API version 1.26 docs…
thisisms
  • 371
  • 5
  • 19
1
vote
2 answers

Docker API start container returns 404

I try to control a Docker server via the Docker remote API. Commands like /containers/json?all=1 or /containers/15999301b96f/stats are working perfectly fine. But as soon as I try to start, stop or restart a container…
Philipp Brucker
  • 299
  • 1
  • 4
  • 11
1
vote
2 answers

Docker remote api don't restart after my computer restart

Last week I struggled to make my docker remote api working. As it is running on VM, I have not restart my VM since then. Today I finally restarted my VM and it is not working any more (docker and docker-compose are working normally, but not docker…
dmx
  • 1,862
  • 3
  • 26
  • 48
1
vote
1 answer

How can a container enumerate hosts available on the network?

Use case: haproxy container running with docker compose. I want to have the container discover which hosts are available in order to recreate haproxy config and reload it. I know the there will be one or more containers named server1 and server2…
marianov
  • 875
  • 1
  • 9
  • 19
1
vote
1 answer

Setting up the docker api - modification of docker.conf

I found a video about setting up the docker remote api by Packt publishing. In the video we are told to change the /etc/init/docker.conf file by adding "-H tcp://127.0.0.1:4243 -H unix:///var/run/docker/sock" to DOCKER_OPTS=. Then we have to restart…
Lukasz
  • 2,257
  • 3
  • 26
  • 44
0
votes
0 answers

Accessing the shell of a docker container and running multiple commands, always keeping the current shell state

I am currently creating a wrapper kernel for Juptyer Notebook that can interpret Dockerfiles. Do do this I am building a new image after each executed cell and storing the resulting image id. I am using the Low Level API docker provides. By now I…
Marvin34565
  • 71
  • 1
  • 6
0
votes
0 answers

Remote Docker only Binds to tcp6

So I wanted to enable remote docker, to use the API for the daemon from outside the host. My /etc/docker/daemon.json looks like this: { "hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"] } And my…
0
votes
0 answers

Problem running Docker with com.github.dockerjava

I am trying to use docker and run my image with this Java Library: com.github.dockerjava Here is the code : import com.github.dockerjava.api.DockerClient; import com.github.dockerjava.api.command.CreateContainerCmd; import…
SanjiSqurt
  • 75
  • 7
0
votes
1 answer

Calculate sum of all Docker container bandwidth in PHP

I'm trying to estimate the bandwidth of all my running dockers' container on my server. I tried using Docker API v1.41. With a php:8-fpm running in a container. function GetData($url) { $curl = curl_init(); curl_setopt_array($curl, array( …
Lary Ciminera
  • 1,270
  • 8
  • 15
0
votes
0 answers

How do I enable the Docker Engine API on GCP Container Optimized OS

I am trying to enable and use the Docker Engine API on Google Compute Engine Container Optimized OS, so that I can trigger docker exec commands over HTTP. However, when I add the TCP host { "hosts": ["unix:///var/run/docker.sock",…
0
votes
0 answers

Insufficient scope when calling tag list in Docker registry

What do I need to pass to the scope-parameter during authentication to being able to call the /v2/{image}/tags/list for all repositories within my registry? I'm tryting to fetch tag information from my private Docker registry. I was managed to…
Nrgyzer
  • 783
  • 1
  • 14
  • 38
0
votes
0 answers

How to run C++ code in a sandboxed environment using docker client in Golang

I am trying to build a code evaluation service for online judge. It will get C++ code along with some problemId. Then we fetch test cases, judging code, time and memory limits against the give problemId. Finally we run the code, the run the judge…
Sahil
  • 39
  • 2