Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ragnarson/deis-cleanup
Deis docker cleanup script
https://github.com/Ragnarson/deis-cleanup
Last synced: 5 days ago
JSON representation
Deis docker cleanup script
- Host: GitHub
- URL: https://github.com/Ragnarson/deis-cleanup
- Owner: Ragnarson
- Archived: true
- Created: 2016-03-11T10:03:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-10T09:51:40.000Z (about 8 years ago)
- Last Synced: 2024-08-02T12:49:22.005Z (3 months ago)
- Language: Ruby
- Size: 6.84 KB
- Stars: 8
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Dei: deis-cleanup.rb
Awesome Lists containing this project
- awesome-starred - Ragnarson/deis-cleanup - Deis docker cleanup script (others)
README
# deis-cleanup
It's [Deis](https://github.com/deis/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
#### ManualRepeat for each Deis node:
1. Log onto a node:
```
$ fleetctl ssh
```
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.
1. 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= --email=
Password:
WARNING: login credentials saved in /.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
```