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
3
votes
1 answer

When and when not to use tty in Docker Remote API

Main Concerns I use curl to run my requests. Running the requests with postman seems to not show much difference between TTY enabled or disabled. Stderr shows with TTY enabled, but not with TTY disabled. AttachStderr is set to true for both (using…
Alberto Rivera
  • 3,652
  • 3
  • 19
  • 33
3
votes
3 answers

Docker API can’t apply json filters

According to the https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/list-tasks, filter can be only used to get running containers with a particular service name. For some reason, I am getting a full list of all tasks regardless…
Stobor
  • 65
  • 1
  • 6
3
votes
1 answer

How to create and start a container through docker API

I have been playing around with docker and starting containers through scripts but wanted to try out docker api and decided to try dockerode. Now, i cannot manage to bind the host machine IP to the container created. How would i send the following…
Kimpo
  • 5,835
  • 4
  • 26
  • 30
2
votes
0 answers

How do I resolve this Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp 52.1.184.176:443: connect: no route to host

I was getting started with dockers, following the documentation and stumbled onto this Error: $ docker run hello-world with the response: Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get…
2
votes
1 answer

How to run docker mounting volumes using Docker engine SDK and Golang

I have being reviewing the docker engine SDK documentation related with running Docker with Golang (https://docs.docker.com/engine/api/sdk/) I would like to run a container(which is well documented) but I cannot find how can I mount a volume when…
Ferrandinand
  • 444
  • 3
  • 11
2
votes
0 answers

How can I execute predefined docker command from Java application with DockerClient?

I have Java Maven project with com.github.docker-java dependency. There is poor documentation and I have no idea, how to call this command: docker run --rm -v "$(pwd)":/browsertime sitespeedio/browsertime:16.3.0 --video --visualMetrics…
2
votes
0 answers

How to configure memory when creating container in spotify-docker-client

I followed spotify-docker-client user manual and github issues to configure specific memory but i got this error {"message":"Minimum memory limit allowed is 6MB"} i have spring boot project with below code @PostMapping(path = "/create") public…
2
votes
2 answers

A Problem on getting docker stats by Python

I tried to use Python to get the docker stats, by using Python's docker module. the code is: import docker cli = docker.from_env() for container in cli.containers.list(): stream = container.stats() print(next(stream)) I run 6 docker…
2
votes
0 answers

build docker image via docker api with passing buildargs parameter

I tried to build docker image via docker api with passing buildargs parameter My try: curl -X POST -H "Content-Type:application/tar" —unix-socket /var/run/docker.sock —data-binary "@Dockerfile.tar.gz"…
koo
  • 21
  • 2
2
votes
1 answer

Remove slash character in JSON response using jq

Docker Engine API returns container name with / appended { "Id": "8dfafdbc3a40", "Names": [ "/boring_feynman" ], "Image": "ubuntu:latest", "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", …
2
votes
2 answers

Is there a way to obtain the date when the docker image was created using docker API for python

I would like to obtain the created at date for a docker image using docker API. Is this possible? I don't see it in the docs https://docker-py.readthedocs.io/en/stable/images.html. I see a way to obtain it using requests but was hoping to use docker…
py_noob
  • 433
  • 2
  • 8
  • 17
2
votes
1 answer

Binding Docker container created through api

I have a command that creates a docker container, from a docker container and I want to bind a port to the host exec(`curl --unix-socket /var/run/docker.sock -H "Content-Type: application/json" -d '{ "Image": "strategy_baseline", "ExposedPorts": {…
lucas rodriguez
  • 980
  • 2
  • 8
  • 20
2
votes
0 answers

Running Docker commands that require user input with the Golang SDK

I am creating a service which programmatically creates and runs an OpenVPN Docker container (pschiffe/openvpn which extends kylemanna/openvpn) using the Golang SDK. At some point in the process, the command easyrsa init-pki is ran in the…
Andrew Willis
  • 2,289
  • 3
  • 26
  • 53
2
votes
1 answer

How to build local docker image using python API with custom tag name

I have this script: import docker import os localtag = "mypersonaltag" client = docker.from_env() dockerfile_path = os.path.dirname(os.getcwd()) print(dockerfile_path) fname = dockerfile_path + "/Dockerfile" path = os.path.dirname(fname) image,…
change198
  • 1,647
  • 3
  • 21
  • 60
2
votes
2 answers

Docker API v1.40 getting container logs

I'm trying to retrieve container logs using Docker API. Open API documentation of Docker states to get the container logs; syntax that should be used is; /containers/{id}/logs According to documentation there could be three response statuses;…
Capan
  • 686
  • 1
  • 14
  • 32
1 2
3
12 13