So supposedly I have a following file structure where ‘<‘ is current terminal directory
- FolderA
- text.txt
- FolderB <
- Dockerfile
And I want to copy text.txt into the container and print the content.
Dockerfile:
FROM alpine
COPY ../text.txt .
CMD cat text.txt
Issues start even on the docker build .
stage because when you try to do so you get following error
ERROR ...: "/text.txt": not found
(skipped few words with ‘…’)
I was unable to find any clarifying answers on the internet. So is it possible to copy text.txt
without using Docker-Compose?