Code Monkey home page Code Monkey logo

docker-upx's Introduction

docker-upx

Lightweight UPX docker image

Usage

docker run --rm -w $PWD -v $PWD:$PWD quay.io/kkh913/upx:latest --best --lzma -o app.out ./app

Why do we need to make the container image size smaller?

Reducing the size of the container image allows agile service deployment and spatial-efficient image registry management. To do this, here are two things:

  • Use of lightweight base image

    It is common to distribute binary files inside a container as static-linked to remove dependencies. In our case, using a scratch image is more advantageous than the well-known default images busybox and alpine.

  • Reduced executable file size

    UPX is the most well-known executable file packer. Since the compression ratio is usually significant between 50% ~ 70%.

Compare container size with other docker-upx projects

โžœ docker images
REPOSITORY           TAG       IMAGE ID       CREATED          SIZE
quay.io/kkh913/upx   latest    6b16e64aceaa   17 minutes ago   428kB
gruebel/upx          latest    3c533895a64b   3 years ago      1.7MB
lalyos/upx           latest    6fdc9a8475ac   5 years ago      1.15MB

Comments

As a result, there is only a difference in container size - negligible(๐Ÿค”) . And, each docker-upx has the same compression ratio and performance. But, I think that many drops make a shower in our container clusters.

  • Single stage Build
    • ADD his own static-linked upx released on GitHub
    • Packing
  • Fixed version 3.91
  • Multi stage build
    • 1st stage
      • build his own static-linked upx
    • 2nd stage
      • copy upx to busybox
  • Dynamic version -> dev = latest but unstable
  • Multi stage build
    • 1st stage
      • Find official latest release upx using GitHub API and download it
    • 2nd stage
      • Extract *.tar.xz
    • 3rd stage
      • Copy upx to scratch
  • No packing process
    • Official release is already packed
  • Dynamic version -> latest and stable

License

UPX License Agreement

docker-upx's People

Contributors

kkh913 avatar

Watchers

 avatar

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.