I have a question concerning Docker. I'm running a Docker:dind Container, which I'm controlling throuh the API. I'm calling the Dind Container with the following Command
docker run --network some_network --prvileged -e DOCKER_TLS_CERTDIR= -d -p 2375:2375 -p 2376:2376 -v TransformationData:/mnt docker:dind
through the named volume, my Data is getting inside the Dind Container in the /mnt Directory.
Now it gets tricky. I want to run a Container through the API which transforms the Data in the /mnt directory and saves the transformed Data in the same directory, so I can use it through the named volume. the following are the Calls for the API
<REQUEST OPERATION="POST" URL="/containers/create" CONTENT-TYPE="application/json">
<CONTENT>
{
"Image": "citygml4j/citygml-tools",
"AttachStdin": true,
"HostConfig": {"Binds": [
"/mnt:/data[[r]shared, [rw]]"
]}} ,
"Cmd":[
"to-cityjson",
"/data"
]
}
</CONTENT>
</REQUEST>
<REQUEST OPERATION="POST" CONTENT-TYPE="application/json">
<xsl:attribute name="URL">/containers/<xsl:value-of select="substring(//CONTENT,11, 7)" />/start</xsl:attribute>
<CONTENT>{}</CONTENT>
</REQUEST>
The Container gets created, runs and exits, but the Data inside the /mnt Directory stays the same. instead of the "bind" Config I also tried a "mount" config with the same result.
One possible Cause for this Problem is, that the citygml-tools Container does not have write Permission on the /mnt directory of the host. I tried to fix that with the privileged Tag, but that did not work. Also the [[r]shared, [rw]] part in the "bind" should permit write, but it does not work either.
The annoying Part about this is, that the citygml-tools Container does not give any Error Messages or Lo files, so I don't actually know what's happening while I try. It's just a Trial and error like thing right now...
Long story short: What is the best Practice for Accessing Host Data from a Container, and write Data in the Host filesystem from a Container?
Additional Information on citygml-tools:
docker runcommand