GithubHelp home page GithubHelp logo

deis-cleanup's Introduction

deis-cleanup

It's Deis specific approach to docker image cleanup. Currently available solutions are too io heavy or aren't configurable enough.

Usage

Configuration

Use environment variables to pass the configuration. For example:

docker run --env "ENV_NAME=value" ...`

Possible options:

  • KEEP_LAST_VERSIONS - the number of releases to keep for each repository (default: 2).
  • DRY_RUN - just print the commands (default: false).
  • EXCLUDE_REGEX - regex filter for repository name (default: alpine|deis|blackhole|none|datadog|cleanup|heroku|python).
  • CLEANUP_CONTAINERS - cleanup exited containers (default: true)

deis-builder

  1. Log onto the deis-builder container:
$ fleetctl ssh deis-builder
$ nse deis-builder
  1. Pull deis-cleanup image:
$ docker pull twobox/deis-cleanup
  1. Run deis-cleanup:
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm twobox/deis-cleanup

Regular Deis node

Manual

Repeat for each Deis node:

  1. Log onto a node:
$ fleetctl ssh <machine id>
  1. Follow steps 2. and 3. from usage on deis-builder.

Service

  1. Load the service:
$ fleetctl load deis-cleanup.service
  1. Start the service:
$ fleetctl start deis-cleanup.service
  1. Wait until the process will finish and destroy it (optional):
$ fleetctl destroy deis-cleanup.service

Development

  1. Update the code.
  2. Build:
$ docker build -t twobox/deis-cleanup .
...
Successfully built 902499c7cfb8
  1. Tag:
$ docker images | grep deis-cleanup
deis-cleanup        latest              902499c7cfb8        6 minutes ago       143.5 MB
$ docker tag 902499c7cfb8 twobox/deis-cleanup:latest
$ docker images | grep deis-cleanup
deis-cleanup          latest              902499c7cfb8        10 minutes ago      143.5 MB
twobox/deis-cleanup   latest              902499c7cfb8        10 minutes ago      143.5 MB
  1. Login (optional, it has to be done only once):
$ docker login --username=<login> --email=<email>
Password:
WARNING: login credentials saved in <home>/.docker/config.json
Login Succeeded
  1. Push:
$ docker push twobox/deis-cleanup
The push refers to a repository [docker.io/twobox/deis-cleanup]
...
latest: digest: sha256:cdc617c74cc2b8332eaa0f844571309e7b291f1b483a7372a316d62395e0b3f1 size: 12968

deis-cleanup's People

Contributors

smt116 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deis-cleanup's Issues

Can't delete some images

Using a stateless deis 1.12.3, some images can't be deleted because it's in use. The containers should be removed first.

Error response from daemon: Conflict, cannot delete 9a654fb551d6 because the container 11379f004d9f is using it, use -f to force
Error: failed to remove images: [10.xx.yy.zz:5000/production:v45]

The command used was:

docker run \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /var/lib/docker:/var/lib/docker \
 --rm \
 twobox/deis-cleanup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.