I couldn't transfer data to created emptyDir


I have to comment the copy command im my dockerfile.
#COPY /app /app
How can I copy “app” directory to inside pod’s container.

I tried initContainers and emptyDir.
But I couldn’t transfer data to created emptyDir.

How can I do that?

The initContainer should seed the data in the emptydir (e.g. wget), it will do any fetching / permission changes etc.

Though I would highly discourage you from doing so - you can create a bash script inside your container that will fetch the binary when the container starts and put that as the command being run at container start (entrypoint).

curl  http://example.com/app -o /tmp/app
chmod +x /tmp/app

this will break the artifact (make the container dynamic in its operation - see article about artifacts)