A
A
alex stephen2016-10-18 17:52:09
Docker
alex stephen, 2016-10-18 17:52:09

How to use docker to execute applications one time?

Perhaps the title is worded crookedly.
I'll give you an example. I installed a docker image with python:latest
I have some test file test.py
Is there any way to use docker to write on the host system instead of python34 test.py
docker run python python34 test.py
ie. Roughly speaking, in order not to put the python in the parent system, but to use it within the container, and receive in response only what the script will give in the output

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tyranron, 2016-10-18
@berezuev

Can. But applications inside a container only see the container's file system. You need to mount your test.py file inside the container first.
If you get some files as a result of running test.py, make sure that they are also written to the mount directory, otherwise, upon completion of the work, they will remain clogged inside the container (and deleted along with the container, because it uses -- rm flag).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question