에 사본을 사용하여 호스트합니다. 도커 컨테이너에서 호스트 컴퓨터로 파일을 복사하고 싶습니다. 고정 표시기-PY 문서에서내가 고정 표시기-평을 사용하고 고정 표시기 - 평
:
copy
Identical to the docker cp command. Get files/folders from the container.
Params:
container (str): The container to copy from
resource (str): The path within the container
Returns (str): The contents of the file as a string
내가 컨테이너를 만들고 시작하지만 호스트 컨테이너에서 복사됩니다 파일을 얻을 수 없습니다 수 있습니다. 내가 누락 된 부분을 지적하면 누군가 나를 도울 수 있습니까? 호스트에 복사를 시도한 나의 도커 컨테이너에 /mydir/myshell.sh가 있습니다. 누군가가 나에게 그것을 복사하거나 파일을 복사 여부를 알아내는 데 도움이 경우
>>> a = c.copy(container="7eb334c512c57d37e38161ab7aad014ebaf6a622e4b8c868d7a666e1d855d217", resource="/mydir/myshell.sh") >>> a
<requests.packages.urllib3.response.HTTPResponse object at 0x7f2f2aa57050>
>>> type(a)
<class 'requests.packages.urllib3.response.HTTPResponse'>
매우 도움이 될 것입니다.
가? –