Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Keep docker container size under control #165

Closed
1 task
reubano opened this issue Oct 16, 2017 · 8 comments
Closed
1 task

Keep docker container size under control #165

reubano opened this issue Oct 16, 2017 · 8 comments

Comments

@reubano
Copy link
Contributor

reubano commented Oct 16, 2017

Overview

It appears that multiple runs of docker-compose -f local.yml build increase the size of the Data without removing stale artifacts. My current ~/Library/Containers/com.docker.docker folder is over 26GB. There should be a convenient script that can be run to remove all unneeded docker files.

Expected Behavior

Running the script should remove all unneeded docker files.

Technical details

  • sample clean commands
docker ps -aqf status=exited | xargs docker rm
docker images -qf dangling=true | xargs docker rmi
  • the clean commands should not remove the image caches

  • This feature should be implemented in local.yml

Acceptance criteria

  • running docker-compose -f local.yml build should first remove unneeded docker files

NOTE: All PRs must follow the standard PR checklist.

@gilcolon71
Copy link

Hi!

I'm a data science student and I'm very interesting in this topic/solution. Have you considered using an alpine base image?

@reubano
Copy link
Contributor Author

reubano commented Oct 20, 2017

Hi @gilcolon71, while switching to a smaller base image like alpine can definitely be useful, that's more of a peripheral concern. I think docker/for-mac#371 does a better job of explaining the key issue.

@isms isms modified the milestones: 1-mvp, 2-feature-building Oct 29, 2017
@WGierke
Copy link
Contributor

WGierke commented Nov 22, 2017

From Allow compose to run arbitrary commands at the host level after or before containers are started:
command is always run in a container. docker-compose is not a tool for running commands on the host.
Seems like we need to put your suggested commands into an extra bash script :/

@calvernaz
Copy link

This comment details a solution that worked for me, after installing docker edge on High Sierra the Data folder moved from 36GB to 1.4GB

@reubano
Copy link
Contributor Author

reubano commented Dec 4, 2017

@WGierke and @calvernaz thanks for the input! So I guess the solution is to upgrade and manually clean occasionally?

@calvernaz
Copy link

Indeed

@WGierke
Copy link
Contributor

WGierke commented Dec 4, 2017

I think so, yes

@reubano
Copy link
Contributor Author

reubano commented Dec 4, 2017

@calvernaz and @WGierke got it. Perhaps we should update the documentation to include this information then.

@reubano reubano closed this as completed Dec 4, 2017
@reubano reubano mentioned this issue Jan 17, 2018
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants