I have been having trouble executing my python script in a remote server. However, when I build the docker image in my local machine (macOS Mojave), the docker image executes my script fine. The same docker image built in the remote server has issues with running the python script in the docker image. I was under the impression that the docker image would produce the same results regardless of its host OS. Correct if I'm wrong and what I can do to produce the same results in the remote server VM. What exactly is the underlying problem causing this issue? Should I request a new remote VM with certain specifications?
Related
Docker for Windows.
I've written a docker image for a python project.
When I start a container based on this image, one of the instructions that gets executed is the following:
os.system(f"start \"\" "path/to/pdf_file.pdf")
which simply opens the specified PDF file with the default PDF opener.
This instruction works perfectly locally, but, if I run it from a docker container, this file doesn't get opened in my local machine.
This makes sense, it probably gets opened in the docker container, and I can't see it because I've no way of seeing what's going on in the container (except by looking at the container logs).
My goal is to have the docker container TELL to my local machine to execute that command, in such a way the PDF file gets opened in my local machine, not in the docker container.
How could I achieve such goal?
I'm new to docker. I have deployed a python server in a docker container. And I'm able to access using my python application from my machine using virtual machine IP(192.168.99.100).
Ex: http://192.168.99.100:5000
How do I access my the application from the other machine which is in the same network?
I tried giving my machine IP but didn't work.
I run the application using "docker run -p 5000:80 myPythonApp"
An easy way out would be to forward port from your host machine to the virtual machine.
Solution may differ w.r.t the VM providers & Host OS that you use. Like for vagrant you can do something as below -
https://www.vagrantup.com/docs/networking/forwarded_ports.html
I'm trying to dockerize a python/django application. When Docker runs the build script in a web container, it is unable to retrieve the images from application.
It shows an error:
and on Google chrome console it shows:
But what is interesting is that I don't get any errors when I do the same on my local machine.
Everything goes as expected.
Docker version 18.03.1-ce, build 9ee9f40
I want to use a Python Docker image running on a powerful remote machine (cloud or local network - but different from the one I sit in front of and installed PyCharm on) as PyCharm Python remote interpreter.
How do I set up the PyCharm access?
Do I need to run an ssh server on the docker image and treat it as a classic ssh remote interpreter while setting up port mapping on the cloud host machine?
The tutorials (e.g. https://blog.jetbrains.com/pycharm/2017/03/docker-compose-getting-flask-up-and-running/) apparently only apply to Docker and the Docker image running locally on the same machine as PyCharm, "localhost" or "127.0.0.1". I would like "some_machine_with_many_gpus.cloudapp.net:port" or similar. Is this possible?
I am creating Python code that will be built into a docker image.
My intent is that the docker image will have the capability of running other docker images on the host.
Let's call these docker containers "daemon" and "workers," respectively.
I've proven that this concept works by running "daemon" using
-v /var/run/docker.sock:/var/run/docker.sock
I'd like to be able to write the code so that it will work anywhere that there exists a /var/run/docker.sock file.
Since I'm working on an OSX machine I have to use the Docker Quickstart terminal. As such, on my system there is no docker.sock file.
The docker-py documentation shows this as the way to capture the docker client:
from docker import Client
cli = Client(base_url='unix://var/run/docker.sock')
Is there some hackery I can do on my system so that I can instantiate the docker client that way?
Can I create the docker.sock file on my file system and have it sym-linked to the VM docker host?
I really don't want to have to build my docker image every time I was to test a single line code change... help!!!