Skip to main content

No project description provided

Project description

docker-image-size-limit

wemake.services Build Status Build status Coverage wemake-python-styleguide

Installation

pip install docker-image-size-limit

Usage

We support just a single command:

$ disl your-image-name:label 300MiB
your-image-name:label exceeds 300MiB limit by 14.4 MiB

Options

You can specify your image as:

  • Image name: python
  • Image name with tag: python:3.6.6-alpine

You can specify your size as:

  • Raw number of bytes: 1024
  • Human-readable megabytes: 30 MB or 30 MiB
  • Human-readable gigabytes: 1 GB or 1 GiB
  • Any other size supported by humanfriendly

Should I use it?

You can use this script instead:

LIMIT=1024
IMAGE='your-image-name:latest'

SIZE="$(docker image inspect "$IMAGE" --format='{{.Size}}')"
test "$SIZE" -gt "$LIMIT" && echo 'Limit exceeded'; false

But I prefer to reuse tools over custom bash scripts here and there.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker-image-size-limit-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

docker_image_size_limit-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file docker-image-size-limit-0.1.0.tar.gz.

File metadata

  • Download URL: docker-image-size-limit-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Darwin/18.2.0

File hashes

Hashes for docker-image-size-limit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4519684b1469db5e11b87915d363dcfcf185b062c25c7c4d82d0098be70ed44
MD5 5d69d54e4564cafa95b3e0052134cf1c
BLAKE2b-256 f04da7f65248458a8ac640689a16ac7b34b550f2d5406864e9bd49c5f7645d51

See more details on using hashes here.

File details

Details for the file docker_image_size_limit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_image_size_limit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cb81754c00808094e8efcaf10bd5e0a4eaa4f3ebe21f04c7d523130ae713a02
MD5 6beffd558d430d9ef97fd4400e9db96a
BLAKE2b-256 338521bdb0fa23d923fb85a0b57dad8f4ff5fb5490096baf938364685596588a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page