Pages

Monday, July 24, 2023

How to copy a file from a docker container to host?

How to copy a file from a docker container to host?

[root@osboxes ~]# docker ps -a

CONTAINER ID   IMAGE           COMMAND            CREATED             STATUS          PORTS     NAMES

d68f6730f12a   centos:latest   "/usr/sbin/init"   19 minutes ago      Up 19 minutes             pgdb3

2d13c81a8040   centos:latest   "/usr/sbin/init"   19 minutes ago      Up 19 minutes             pgdb2

1a9928f7c2f6   centos:latest   "/usr/sbin/init"   About an hour ago   Up 22 minutes             pgdb1

[root@osboxes ~]# docker cp 1a9928f7c2f6:/qader/qader1 /root

Successfully copied 1.54kB to /root

No comments:

Post a Comment