Skip to content

Dockerized UPX from master branch of upx/upx

License

Notifications You must be signed in to change notification settings

LANsible/docker-upx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-upx

Build Status Docker Pulls Docker Version Docker Size/Layers

Dockerized static UPX which allows easy copy and usage of UPX. Since the arm64 builds of UPX seem non existing for Alpine I needed this :)

Usage

Direct

Run it directly on a mapped volume

docker run --rm -v "$PWD/foo:/foo" lansible/upx --ultra-brute -o /foo/bar.upx /foo/bar

Docker multistage

Use it to minify binaries in a multistage Docker build

FROM your/baseimage
COPY --from=lansible/upx /usr/bin/upx /usr/bin/upx
RUN upx --ultra-brute --ultra-brute --best -o /foo/bar.upx /foo/bar

Help

Run the image without a command to see the UPX help

docker run --rm lansible/upx

For more information about UPX see upx/upx and their documentation

Building

The image accepts a build-arg that sets the UPX version to build. This arg gets passed to git clone --branch <arg>, so everything --branch supports will work (branches & tags) Also it uses the multiarch/alpine image for easy QEMU emulation. To be able to cross-compile register the binaries first:

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Then pass the ARCHITECTURE build-arg to cross-compile for arm64 for example.

docker build . -t upx:devel --build-arg VERSION=devel --build-arg ARCHITECTURE=amd64

About

Dockerized UPX from master branch of upx/upx

Resources

License

Stars

Watchers

Forks

Packages

No packages published