The file in the container is missing while deploying as a kubernetes pod

10/23/2019

I have copied a file "sample.txt" into the container using the ADD command in Dockerfile.

While running as a container, the 'sample.txt' file is present inside the container.

But while running as a kubernetes pod the copied 'sample.txt' file is missing.

Please help me to understand why this is happening.

-- Bhavani Prasad
docker
kubernetes

2 Answers

1/30/2020

I had this issue. I was mounting an emptydir volume on top the files I had copied. Check your yaml file and see if this is the case.

-- WPWoodJr
Source: StackOverflow

10/23/2019

can you run below command and check if the file is present

docker run -it <image-name> /bin/sh
-- P Ekambaram
Source: StackOverflow