GoogleCloudPlatform / cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
https://cloud.run
Apache License 2.0
526 stars 91 forks source link

docker build fails with no more space left #140

Closed ksivasenthil closed 4 years ago

ksivasenthil commented 4 years ago

I click the button "Run on Google Cloud" to launch the Google Cloud Shell. Once I land on the shell, I select the project to which I need the sample to be deployed and the region. All is well till then.

Post that I notice the following command is run -

docker build -t gcr.io/[project-id-masked]/cloud-run-button .

After waiting for a long time I get the error

[ ✖ ] Failed to build container image.
Error: attempted to build and failed: docker build failed: exit status 1, output:
 Step 5/10 : RUN go mod download
   ---> Running in 75392b519c70
 go: finding github.com/fatih/color v1.7.0
 ….
 ….
 ….
 failed to register layer: Error processing tar file(exit status 1): write /usr/share/dotnet/sdk/2.2.402/Sdks/NuGet.Build.Tasks.Pack/CoreCLR/NuGet.Build.Tasks.Pack.dll: no space left on device

I attempted the following commands and noticed the docker system used up all the memory

docker system df

Following is the output -

TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 2 0 1.094GB 1.094GB (100%)
Containers 0 0 0B 0B
Local Volumes 0 0 0B 0B
Build Cache 0 0 0B 0B

But the system level df yields the following output -

Filesystem 1K-blocks Used Available Use% Mounted on
overlay 47259264 38154056 9088824 81% /
tmpfs 65536 0 65536 0% /dev
tmpfs 1021944 0 1021944 0% /sys/fs/cgroup
/dev/sda1 47259264 38154056 9088824 81% /root
shm 65536 0 65536 0% /dev/shm
overlayfs 1024 164 860 17% /etc/ssh/keys
tmpfs 1021944 724 1021220 1% /run/metrics
overlayfs 1024 164 860 17% /etc/ssh/ssh_host_dsa_key
tmpfs 1021944 0 1021944 0% /run/google/devshell

I also attempted the command docker system prune --all --force which reclaims all the 1.094 GB. However, if I re-run the "Run on Google Cloud" I hit against the same problem.

What should I change to have a successful build. I did some search on increasing the memory for the docker system. But, with no luck. More and more commands are towards increasing the docker container memory. But for me, I am stuck even to get an image registered in the docker repository let alone reach the stage of running a container.

I did all this in a fresh google cloud account. I do not understand what is going wrong here.

jamesward commented 4 years ago

What repo did you try this with?

ksivasenthil commented 4 years ago

This repo. Url to launch the cloud shell was https://deploy.cloud.run/?git_repo=https://github.com/GoogleCloudPlatform/cloud-run-hello.git

jamesward commented 4 years ago

Strange. It looks like it cloned the wrong repo. It should have cloned https://github.com/GoogleCloudPlatform/cloud-run-hello.git

Can you verify you are on master and which repo it cloned?

ksivasenthil commented 4 years ago

Apologies, seems I had the wrong link and did not even realize it. Master branch is just fine. But I guess the problem will surface with larger repo or a repo with larger docker. Worried about such a scenario now. But I guess will take this question to forum rather than an issue here which it clearly is not. Thanks @jamesward !

jamesward commented 4 years ago

No worries! I appreciate you filing this cause others may run into the same thing. Is there somewhere that provided you the wrong link?