Question : The Nautilus DevOps team has some conditional data present on App Server 2 in Stratos Datacenter. There is a container ubuntu_latest running on the same server. We received a request to copy some of the data from the docker host to the container. Below are more details about the task:
On App Server 2 in Stratos Datacenter copy an encrypted file /tmp/nautilus.txt.gpg from docker host to ubuntu_latest container (running on same server) in /usr/src/ location. Please do not try to modify this file in any way.
Solution:
1. At first login on app server as per the task & Switch to root user
thor@jump_host
/$ ssh steve@stapp02 The authenticity
of host 'stapp02 (172.16.238.11)' can't be established. ECDSA key
fingerprint is SHA256:weaGymLcSWqaAGcLzZFDlklQfE0lt1aXhOrG6KoBppI. ECDSA key
fingerprint is MD5:82:38:e7:9f:da:16:f7:7a:62:5f:08:c7:a5:87:81:0d. Are you sure you
want to continue connecting (yes/no)? yes Warning:
Permanently added 'stapp02,172.16.238.11' (ECDSA) to the list of known hosts. steve@stapp02's
password: [steve@stapp02
~]$ sudo su - We trust you have received the usual lecture from the local System Administrator.
It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great
responsibility. [sudo] password for steve: [root@stapp02 ~]# |
2. Run Below command to check existing docker container running
[root@stapp02
~]# docker ps CONTAINER
ID IMAGE COMMAND CREATED STATUS PORTS NAMES 41bcf083aad3 ubuntu "bash" 5 minutes ago Up 5 minutes ubuntu_latest [root@stapp02
~]# |
[root@stapp02
~]# docker cp /tmp/nautilus.txt.gpg ubuntu_latest:/usr/src [root@stapp02
~]# |
[root@stapp02
~]# docker exec ubuntu_latest ls -ltr
/usr/src total 4 -rw-r--r-- 1
root root 74 Jun 29 04:53 nautilus.txt.gpg [root@stapp02
~]# |
Happy Learning!!!!
0 Comments