[DOCKER] no space left on device What to do if an error occurs

Introduction

When I was developing in the Docker environment, when I did docker-compose build, I got the same error twice, so I posted it so I don't forget it.

Dealing with this error

I tried two methods because I only knew that there was not enough capacity because I was still learning

Delete images at once

This method worked best for me If you repeat build, images will be piled up and capacity will be used.

$ docker image prune
#Can I delete it? Since it works, enter y and enter
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] y

This is an excellent one that saves space by leaving only the latest build and deleting all others at once!

Delete volume

This was also a little effective

#Check for invalid volumes
$ docker system df
$ docker volume ls -q -f dangling=true
#Delete unreferenced volumes
$ docker volume rm `docker volume ls -q -f dangling=true`

reference

I learned a lot. Thank you very much. https://qiita.com/sakymark/items/df58ea2fd9179eddc566

Recommended Posts

no space left on device What to do if an error occurs
What to do if an ActionController :: UnknownFormat error occurs
What to do if an error occurs when nokogiri enters when bundle install
wildflly10 java8 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906 What to do if an error occurs
What to do if you get an error on heroku rake db: migrate
What to do if a SAX Parser error occurs when using Liferay 7 / DXP on AWS
Add gem'rails-i18n','~> 6.0.0' and what to do if bundle install gives an error
[Spring Boot] What to do if an HttpMediaTypeNotAcceptableException occurs on an endpoint for which produces is set
What to do if you get an uninitialized constant Likes Controller error
What to do if an SSH key authentication error occurs during automatic deployment to EC2 with Capistrano
What to do if you get an error when you hit Heroku logs
What to do if an error occurs when doing npm install axios in React + Typescript project
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
What to do if ClassNotFoundException occurs when starting Tomcat
What to do if TextToSpeech doesn't work on Android 11
What to do when a null byte error occurs
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
What to do if you get the error Couldn't find Item without an ID
What to do if you get a port error when docker-compose up on Mac
What to do if audio is not available on discordrb
What to do if mysql2 gets a bundle install error
[Rails] What to do if you can't get an error message with the errors method
What to do when javax.batch.operations.JobStartException occurs
What to do if you get an error in Basic authentication during Rails test code
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
What to do if you get a gcc error in Docker
What to do if you get a DISPLAY error in gym.render ()
Notes on what to do if Ubuntu 20.04 installation on Virtual box 6.1 (Windows10) fails with "Error 5 Input / output error"
What to do if you go offline due to SSL certificate error when running Jenkins on Mac
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do when a javax.el.PropertyNotWritableException occurs
What to do if you install Ubuntu
What to do if deployment fails on Heroku (Ruby app not detected)
What to do if you get a MiniMagick vulnerability alert on GitHub
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if an error occurs in VS Code when importing a django module or your own module installed by pip install
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you get the error message unrecognized selector send to instance "***"
What to do if the server tomcat dies
When I tried to start GlassFish, I got an internal error while "Publishing to GlassFish 4.0 on localhost ...". What to do when it becomes
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if you push incorrect information
What to do if you have installed Java for OS X on macOS
What to do if Docker Desktop fails to launch on your M1 MacBook Pro
What to do if mvn archetype: generate fails
What to do when IllegalStateException occurs in PlayFramework
What to do if the rails server doesn't run out on AWS cloud9
What to do if ffi installation fails when launching an application in Rails
[Java] What to do if you get an error in Eclipse saying "Not allowed at source level below 1.X"
What to do if you get an Argument Error: wrong number of arguments (given 2, expected 0) in your RSpec test
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do if you get a wrong number of arguments error in binding.pry
What to do if you can't get the text of an element in Selenium
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if Failure / Error: require File.expand_path ('../ config / environment', __dir__) appears in RSpec
What to do if the debug gem installation fails