Secure File Transfer to Docker Container
Objective
To securely transfer a confidential, encrypted file nautilus.txt.gpg
from the Docker host system to a running container named ubuntu_latest
, ensuring that the file is not altered during the process.
File Details
-
Source:
/tmp/nautilus.txt.gpg
(on Docker host) -
Destination:
/tmp/nautilus.txt.gpg
(insideubuntu_latest
container) - Size: 2.05 KB
- Type: GPG-encrypted confidential data
Steps Performed
- Verified Container Status
Confirmed that the ubuntu_latest
container was running on App Server 1:
docker ps
- Executed File Transfer
Used the docker cp
command to copy the encrypted file into the container:
docker cp /tmp/nautilus.txt.gpg ubuntu_latest:/tmp/
Output: Successfully copied 2.05kB to ubuntu_latest:/tmp/
- Verified File Presence Inside the Container
Ensured the file exists in the container’s /tmp
directory with correct permissions:
docker exec -it ubuntu_latest ls -l /tmp/nautilus.txt.gpg
Output:
-rw-r--r-- 1 root root 105 Sep 9 09:13 /tmp/nautilus.txt.gpg
Outcome
The file was successfully copied without modification, maintaining its original size and integrity. This secure transfer ensures the encrypted data is now available within the containerized environment for further controlled processing or decryption.
Conclusion
This task demonstrates the secure and efficient movement of sensitive files into containerized environments using standard Docker utilities. Proper file handling practices were followed, aligning with the organization’s DevOps and security policies.
Top comments (0)