Docker Copy Operations

Ticker

6/recent/ticker-posts

Docker Copy Operations

 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.

 Please Note :-  Perform the below commands based on your question  server,  user name & other details might differ . So please read task carefully before executing. 
All the Best 👍

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 ~]#


3. Copy an encrypted file /tmp/nautilus.txt.gpg on docker container ubuntu_latest
     

[root@stapp02 ~]# docker cp /tmp/nautilus.txt.gpg ubuntu_latest:/usr/src

[root@stapp02 ~]#

  
4. Validate the task by running the command

[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 ~]#


5.  Click on Finish & Confirm to complete the task successful

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , please go through and share your comments. Like and share the knowledge



Post a Comment

0 Comments

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user