Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kpcyrd/mini-docker-rust
Very small rust docker image
https://github.com/kpcyrd/mini-docker-rust
alpine docker rust
Last synced: 5 days ago
JSON representation
Very small rust docker image
- Host: GitHub
- URL: https://github.com/kpcyrd/mini-docker-rust
- Owner: kpcyrd
- License: mit
- Created: 2017-04-29T01:23:03.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-01-07T18:11:57.000Z (about 1 year ago)
- Last Synced: 2025-01-01T07:05:46.930Z (12 days ago)
- Topics: alpine, docker, rust
- Language: Dockerfile
- Size: 32.2 KB
- Stars: 224
- Watchers: 6
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-cn - kpcyrd/mini-docker-rust - ci.org/kpcyrd/mini-docker-rust.svg?branch=master">](https://travis-ci.org/kpcyrd/mini-docker-rust) (Development tools / Deployment)
- awesome-rust - kpcyrd/mini-docker-rust - ci.org/kpcyrd/mini-docker-rust.svg?branch=master">](https://travis-ci.org/kpcyrd/mini-docker-rust) (Development tools / Deployment)
- awesome-rust - kpcyrd/mini-docker-rust
- awesome-rust-cn - kpcyrd/mini-docker-rust - 一个非常小的Rust (开发工具 Development tools / 部署 Deployment)
- awesome-rust-zh - kpcyrd/mini-docker-rust - 非常小的,螃蟹 docker 镜像的示例项目[<img src="https://api.travis-ci.org/kpcyrd/mini-docker-rust.svg?branch=master">](https://travis-ci.org/kpcyrd/mini-docker-rust) (开发工具 / 部署)
- awesome-rust - kpcyrd/mini-docker-rust - An example project for very small rust docker images (Development tools / Deployment)
- awesome-rust - kpcyrd/mini-docker-rust - ci.org/kpcyrd/mini-docker-rust.svg?branch=master">](https://travis-ci.org/kpcyrd/mini-docker-rust) (开发工具 Development tools / 部署 Deployment)
- fucking-awesome-rust - kpcyrd/mini-docker-rust - An example project for very small rust docker images (Development tools / Deployment)
- fucking-awesome-rust - kpcyrd/mini-docker-rust - An example project for very small rust docker images (Development tools / Deployment)
README
# mini-docker-rust ![docker-github-action](https://github.com/kpcyrd/mini-docker-rust/actions/workflows/test-docker.yml/badge.svg)
Very small rust docker image.
This is an example project on how to build very small docker images for a rust project. The resulting image for a working `hello world` was 5.69MB in the case of Alpine 3.16. Alpine versions have changed in size with past releases (see below a table with historic sizes of the docker images). Using end-of-life Alpine/Rust releases is not advised (even if they might be slightly smaller). Checked sizes with `docker system df -v`
| Alpine | Size |
| ----------- | ------ |
| alpine:3.19 | 8.22MB |
| alpine:3.18 | 8.22MB |
| alpine:3.17 | 7.95MB |
| alpine:3.16 | 5.69MB |
| alpine:3.15 | 5.74MB |
| alpine:3.14 | 5.73MB |This repo is trying to keep the docker overhead to a minimum without sacrificing performance or the usability implications of using `FROM scratch`. If you want to reduce the binary size further you might be interested in [johnthagen/min-sized-rust](https://github.com/johnthagen/min-sized-rust).
## See for yourself
You don't need to install anything besides docker. Build with `docker build -t mini-docker-rust .` and run with `docker run mini-docker-rust`.
## Annotated docker file
See [Dockerfile](Dockerfile).