So I have this folder

In which I run (using Powershell)
Get-Content Dockerfile | docker build -
But I get the following error :
=> ERROR [8/8] COPY docker-entrypoint.sh /
0.0s
------
> [8/8] COPY docker-entrypoint.sh /:
------
failed to compute cache key: "/docker-entrypoint.sh" not found: not found
This obviously has something to with an absolute path problem, but what is the intended fix for this ? I've tried multiple things from stackoverflow without success (changing CRLF to LF, using . instead of /, etc).
Thanks.
When you build using docker build - there is no build context and you can't use COPY or ADD, unless they copy from a URL.
Since there is no context, a Dockerfile ADD only works if it refers to a remote URL.
You need a context, so you should use
docker build -t myimage .
instead.
More info here https://docs.docker.com/engine/reference/commandline/build/#build-with--
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With