I have a project I am building that uses Vue with Vite and Nuxt. The project uses Docker, and the docker container builds completely normally in my local environment. When I try to build the docker container in the bitbucket pipeline environment, it fails every time. I have tried many different solutions around allocating space, but they haven't made a difference. I also can't find any way to get a more detailed error log, so the only error I'm left with tells me nothing. I also have tried making my environment as close to the bitbucket pipelines as I can, but every build still works locally. I'm left with these questions:
1) How can I get a more helpful error log?
2) Are there any tools for replicating the bitbucket pipeline environment on my computer so I can reproduce the problem locally?
3) Why would a docker build work locally but not in the bitbucket pipeline? Isn't the point of docker that it works in every environment? (My best lead at the moment is that they use two different networks, but I don't know how that would change anything)
This is my Docker file:
Hey @bweber ,
and welcome to the Community!
By reading your description, I understand the error is happening during a Docker build. The Docker build is executed in a separate container (docker service container) from the build container (where the script runs) and has its own memory allocated to it.
I suspect you may be using the default memory allocated to docker service, which is 1GB, and this is not being enough for the npm command to complete, hence causing your build to fail.
For that, I would suggest that you increase the memory for the docker service by adding the following definition to your YML file :
definitions:
services:
docker:
memory: 2048
This would make 2GB of memory available for the docker service. You can start with 2GB and increase it as needed.
Considering that the docker service is the only service in your step, in normal steps you can increase the size of the docker service up to 3GB, while in large steps (size: 2x), it can be defined as up to 7GB.
For more details on how memory is allocated between the build and service containers, I would also recommend checking the following documentation:
I hope that helps! Let us know in case you have any questions.
Thank you, @bweber !
Patrik S
Hi Patrik,
Thank you for the welcome!
The solution you proposed ended up working! Thank you so much. I have spent countless hours running in circles over this, and I really appreciate you taking the time to respond.
Thanks again!
Braden
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.