After Laravel Sail install, I published the Laravel Sail docker files to my project following the official docs. The directory is at {project root}/docker/8.1
. This directory is also the one specified as build context in the docker-compose.yml
file. I added a .dockerignore
file in that directory with the following content:
**/.devcontainer
**/.git
**/.vscode
**/docker
[...]
When I terminal into the laravel container, the directories and files in my .dockerignore
have been copied over despite [internal] load .dockerignore
log statement on sail build
. sail build
is basically an alias for docker compose build
.
How can I set-up my .dockerignore
for it to be applied on container build?
As a side-note, I don't really understand how the project source files are copied over to the container, as the Dockerfile
does not seem to contain COPY
or ADD
instructions wrt these.
I have looked on this site for answers and on the web without success. I also went through the laravel/sail github issues.
Any input would be greatly appreciated.