34 questions
-1
votes
2
answers
318
views
How to send command to server stdin in a docker image
I have a game server that I'm running in a docker image. If you send 'status' to the server stdin it will send the status of the server to it's stdout. I'm trying to find a way to send 'status' to the ...
0
votes
1
answer
222
views
mktime resulting in OverflowError: mktime argument out of range
When attempting to get a time using mktime, I get a overflow exception. This occurs on a Debian docker image, but not on my host machine:
docker pull python:3.9.7
https://hub.docker.com/layers/...
0
votes
0
answers
68
views
docker-compose dns and python docker api nested container
The cis container is running a simple flask server that calls daemon() on the backend. As part of the nested container's functionality, it needs to be able to access the git container as well as other ...
1
vote
0
answers
64
views
await Docker().containers.get() and .delete() are stuck for some containers, what might be the cause?
On one of three identical machines running Ubuntu:22.04 and Python 3.10.12 I'm encountering a strange problem with aiodocker: await client.containers.get(ident) and await container.delete() are stuck ...
-1
votes
1
answer
2k
views
What is the correct Dockerfile to install pyodbc on python:3.10.9-slim-buster image?
I have been using this guide for Debian 10.
I also needed install g++ for the pyodbc package to be installed.
I am using this dockerfile:
FROM python:3.10.9-slim-buster
RUN apt-get update -y &&...
0
votes
1
answer
181
views
Executing docker exec concurrently
Actually the docker python sdk is working fine:
https://docker-py.readthedocs.io/en/stable/client.html
But I tried to perform docker exec with asyncio package simultaneously.
It seems not to be ...
0
votes
0
answers
80
views
How to connect database is running inside the container container from outside?
I have created postgres docker image using docker-compose up command.
docker-compose up command is also installing some python packages like poetry ,python3,pip etc. once container is up we are ...
-1
votes
1
answer
114
views
Execute pytest from another python script within docker
I have a test script written using pytest and it works fine when I execute it as standalone.
User:~my_workspace/python_project$ pytest path_to_script/my_script.py
Now I have to run this script with ...
0
votes
3
answers
2k
views
How does one run Great Expectations from Docker using a Dockerfile to build the image
I am pretty new to Great Expectations (GX) and very new to Docker, and now I am trying to combine the two. I can get a Docker image to build just fine, but when I try to run a container, it fails. I ...
1
vote
0
answers
1k
views
Why is it that when executing `build docker` I persistently see EOF?
Having gone through different solutions provided on this platform and surfing the web, my error keeps popping up again and again.
I am inclined to drop my question this time around.
While running ...
1
vote
1
answer
917
views
Docker for Python get DOCKER_HOST
I'm trying to find the DOCKER_HOST for my docker registry.
Looking at the sdk, I know it's possible to set the DOCKER_HOST.
But is it possible to find the current DOCKER_HOST been used?
import docker
...
1
vote
1
answer
1k
views
Bad Request ("error reading build args: json: cannot unmarshal number into Go value of type string")
Using docker python library,
UID = USER_ID = os.getuid()
GROUP_ID = os.getgid()
USER = getpass.getuser()
HOME = "~"
DIR = os.getcwd()
DOCKER_GID = ...
0
votes
0
answers
599
views
Docker-Compose not creating schema from local db while building docker image
I have created a docker-compose file with 2 services web and POSTGRES. When I run the below docker-compose file, it does not create tables that is in my local POSTGRES db. I have provided the ...
0
votes
1
answer
748
views
How to remove network with docker sdk for python?
I am using docker sdk for python.
I am creating a network like so
try:
client.networks.create(name=network_name, check_duplicate=True)
except docker.errors.APIError as ex:
...
-1
votes
1
answer
539
views
Python Docker client is not able to find Docker daemon
I am working on an ubuntu/windows dual booted system, with the following specifications -->
system-specs
And, my Python version is 3.9.7
So, I am trying to run the following python program using ...
0
votes
0
answers
484
views
aiokafka producer running on one core in a python:buster Docker container achieves very low throughput 1 MiB per second
I have some simple code that to test the performance of aiokafka library. I am using a Windows computer, running Docker for Windows, and a virtual machine with 8 cores.
The library aiokafka seems to ...
2
votes
1
answer
3k
views
Install python 3.8 based on .net core 5.0 to Docker
I'm new to use docker and I'm facing to problem to install python in docker based on .net core 5.0
I followed simple tutorials and applied it to server successfully. And I'm trying to apply it to make ...
0
votes
0
answers
490
views
Python script in Docker Container Attach_Socket send not on separate line
I am trying to compile and run python code in Docker.
Dockerfile
FROM python:3
WORKDIR /app
USER root
ADD . .
RUN chmod a+x ./main.py
RUN chmod a+x ./run.sh
ENTRYPOINT ["sh","./run.sh&...
0
votes
1
answer
489
views
How to add constraints in client.services.create while creating a new service in existing docker swarm Python Docker SDK?
I want to create a service in existing swarm network using python docker sdk. I have a swarm network named test_net.
Installation of library : pip3 install docker
Below is the code used for creating ...
0
votes
1
answer
663
views
Python Docker SDK Inside Kubernetes
I followed this link - https://docs.docker.com/engine/api/sdk/examples/ and the docker SDK worked fine while I was using Docker containers. Now that I have moved to K8s, when I run the code I get ...
0
votes
1
answer
645
views
Docker-Py log with tail option is not working
I'm trying to perform an automation using docker package of python. In that I tried to read the logs with tails with below code, But it is showing nothing.
import docker
z=docker.from_env()
dkg = z....
6
votes
0
answers
4k
views
How to get the container log file using docker-py
As part of docker automation am trying to automate certain docker operation using python docker package. Well I have implemented the most of requirement successfully, But could not find an equivalent ...
-1
votes
1
answer
304
views
Is dockerized Selenium in Python a resource hungry process?
I read in an old thread that the dockerized selenium grid is a resource hungry process.
I am trying to run 250 to 300 selenium tests in parallel, and after some research I found out I have 3 options:
...
1
vote
1
answer
556
views
Python docker keeps saying module not found
I am trying to build a docker to host my Discord bot.
The dockerfile is
FROM python:3.8
COPY ./Elevate/* /docker/
RUN python3.8 -m pip install discord.py==1.5.1
RUN python3.8 -m pip install -r docker/...
0
votes
0
answers
346
views
Running copy command in docker python can't handle asterisk
I am trying to run a docker container to copy files from a volume to a local folder:
import docker
client = docker.from_env()
stdout = client.containers.run(
"alpine",
mounts=[
...
2
votes
2
answers
2k
views
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 ...
2
votes
2
answers
2k
views
How to get container name from container ID using python docker module
I would like to get the container name by passing container id. I have tried below for getting that but unfortunately it didn't worked for me.
import docker
def get_container_details(self,container=...
1
vote
0
answers
632
views
Can I get the image id of a docker image without building or pulling it from the repo?
I would like to get the images and image ids of a number of docker images (over 100+). I can't pull all these images on my local machine to fetch the image ids. Is there a way using docker api or ...
1
vote
1
answer
350
views
Python Docker Container: How to install modules e.g. pymqsl?
I would like to use the module "pymysql" with the official python container https://hub.docker.com/_/python The only way I found so far is to make my own container like this:
FROM python:...
1
vote
1
answer
322
views
building docker image using a remote docker file in github using python sdk
I am able to build docker image using python sdk. if the dockerfile is available on my local machine.
client = docker.from_env()
image, build_log = client.images.build(path = "./", tag=...
1
vote
1
answer
1k
views
How to get container stats details using python docker
I am trying to get the docker container stats inside my python code after running the container as shown below. I am referring to python docker SDk https://docker-py.readthedocs.io/en/stable/index....
4
votes
1
answer
9k
views
How to use exec_run in python docker sdk for replacing my docker cli command
I want to replace the below command with docker python sdk
docker exec 6d9c9b679541 /u01/app/oracle/product/12.0.0/dbhome_1/bin/sqlplus sachin/sachin@orcl @1.sql
here is code i am writing and the ...
0
votes
1
answer
745
views
Sending echo input to stdin to a docker container using docker
Below is my sample c program
#include <stdio.h>
int main()
{
int x, y, z;
scanf("%d%d", &x, &y);
printf("%d,%d" ,x,y);
z = x + y;
printf("%d", ...
0
votes
1
answer
1k
views
Converting docker run to python docker, issues passing environmental variables
I'm trying to convert the following docker run command to python docker run:
docker run -v ${HOME}/mypath/somepath:/root/mypath/somepath:ro -v /tmp/report/:/root/report -e MY_VAR=fooname DOCKER_IMAGE
...