Task - Copy File to Docker Container

Task - Copy File to Docker Container

Table of contents

Problem:

The Nautilus DevOps team possesses confidential data on App Server 2 in the Stratos Datacenter. A container named ubuntu_latest is running on the same server.

Copy an encrypted file /tmp/nautilus.txt.gpg from the docker host to the ubuntu_latest container located at /usr/src/. Ensure the file is not modified during this operation.

Solution:

Please ensure to review the task instructions carefully and modify the commands according to your specific server, username, and other relevant details.

  1. ssh into appserver2

  2. Once you are on app server2, execute the below command.

     docker cp /tmp/nautilus.txt.gpg ubuntu_latest:/usr/src/
    

    Note: From the above command /tmp/nautilus.txt.gpg this is the host machine path i.e app server 2 path. ubuntu_latest is the container name and /usr/src/ is the container path.

    References: docs.docker.com/reference/cli/docker/contai..