Skip to content

Use UPX in Docker multi-stage builds

License

Notifications You must be signed in to change notification settings

hatamiarash7/Docker-UPX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker-UPX

Release License Image size

It's a lightweight Docker image of UPX to use in multi-stage builds.

Usage

docker run --rm -w $PWD -v $PWD:$PWD hatamiarash7/upx --best --lzma -o application-compressed ./application

Dockerfile

You can use this image in your Dockerfile for multi-stage builds like this:

# Build

FROM golang:1.19-alpine as builder

<build>

# Compression

FROM hatamiarash7/upx:latest as upx

COPY --from=builder /src /

RUN upx --best --lzma -o /app /app-uncompressed

# Final

FROM scratch

COPY --from=upx /app /app

CMD ["/app"]

Support 💛

Donate with Bitcoin Donate with Ethereum

ko-fi

Contributing 🤝

Don't be shy and reach out to us if you want to contribute 😉

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Issues

Each project may have many problems. Contributing to the better development of this project by reporting them. 👍