If your build keeps failing on Docker Cloud Automated Build but it builds successfully on your local machine, you most like are using a node with insufficient memory to build your image.
The automated build feature on Cloud behaves differently from Docker Hub. On Cloud, builds are performed on one of your nodes on Docker Cloud, whereas builds triggered on Docker Hub are built on dedicated build clusters for Docker Hub.
This is an example error message during the building process:
g++: internal compiler error: Killed (program cc1plus)
To solve this issue, add a new node with larger specs (at least 4GB of memory) and tag it with the builder deploy tag, so that all automated builds trigger on Cloud are built using that node:
- Launch a new node cluster
- Add the tag builder under Deploy tags
- Make sure to select a node type with at least 4GB of RAM
- Launch node cluster
- Rebuild your image
To read more about Automated Builds on Cloud: https://docs.docker.com/docker-cloud/feature-reference/automated-build/.