Troubleshooting when Docker build does not progress. Solution for when seconds continue to progress.
Thank you for your continued support.
This article contains advertisements that help fund our operations.
Table Of Contents
⇨ Click here for the table of contents for Laravel articles
When setting up the Laravel environment with Docker, if Docker build does not progress and seconds continue to progress, we have summarized the solution for that situation.
Generally, there are many syntax errors
Many issues can be resolved by reading the logs.
You can read the logs with a command. Let's calmly look for any mistakes.
docker logs
File paths assumed in Docker configuration files are incorrect
Docker files can seem very complex until you get used to them.
Despite the fact that I touch them normally, it still looks like it's encrypted to me.
services:
web:
container_name: "nuxt-laravel-web"
build:
dockerfile: "./docker/web/Dockerfile"
ports:
- "8081:80"
volumes:
- "./nuxt-laravel:/var/www/html"
For example, when such description is provided, if there is no Dockerfile in this location
"./docker/web/Dockerfile"
or if there is no folder called nuxt-laravel at this location, it should result in an error.
"./nuxt-laravel:/var/www/html"
This description is for mounting, and is separated by ":". The left side is local (your computer) and the right side is the Docker virtual environment.
In other words, it is the part where your environment connects to the virtual environment.
Even if you don't understand at all, as long as you don't make a mistake in the path, it should work.
Share files on Mac
In my Mac environment,
Intel chip
MacOS Ventura 13.6
Docker Desktop 4.20.0
even with this environment, the build would never finish unless I specified the directory of this project in File Sharing.
I feel like in the past, I used to get an error saying "Please add to File Sharing," but why now!
When I asked someone using Windows if they needed to do File Sharing, they said, "No, I don't." I wonder if it's specific to Mac, considering that it's specific to the OS or version.
I feel like I want to monopolize the easiest settings for all versions and tools.
Let's stop wasting time.
Conclusion
That's all. I hope it's helpful for someone.
This blog is supported by clicking on advertisements. Thank you.
Well then!
Popular Articles
Deploying PHP 7.4 + Laravel 6 Project to AWS EC2
Implementing Breadcrumbs in Laravel Using laravel-breadcrumbs