I have a simple Python script inside a Docker container that:
- makes an external API call
-A license file is returned from the API
I want to save the returned license file to my directory inside the docker container.
This is what I did:
r = requests.post("http://api/endpoint", headers=headers, data=data, auth=("", "") f = open('test.lic', 'w+') f.write(r.content) f.close()
I understand that this will create the test.lic file if it does not already exist, or open the existing test.lic file and write the contents of the request object in test.lic . However, this does not work. Not a single file is saved in my directory inside the Docker container. If I run these lines from the python shell, this works, so I assume this has something to do with being inside the Docker container.
source share