https://github.com/cbuschka/distrolessdocker
Distroless docker container with statically linked binaries in different languages
https://github.com/cbuschka/distrolessdocker
distroless docker
Last synced: 7 months ago
JSON representation
Distroless docker container with statically linked binaries in different languages
- Host: GitHub
- URL: https://github.com/cbuschka/distrolessdocker
- Owner: cbuschka
- License: mit
- Created: 2019-05-12T08:31:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-20T16:03:36.000Z (almost 4 years ago)
- Last Synced: 2025-01-16T04:24:45.706Z (9 months ago)
- Topics: distroless, docker
- Language: Makefile
- Homepage:
- Size: 997 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# Distroless docker container with statically linked binaries in different languages
## Background
A docker container is called "distroless" when it is not based on a linux distribution, it is created "FROM scratch". The docker image then consists of a single binary only. The only interface the binary can utilize is the kernel call api, because there are no other libs in the image.Pro:
- small attack vector
- light footprintContra:
- ???This is a collection of programs written in different languages that can be linked statically and so can serve for a distroless docker container.
## Prerequisites
* make
* dockerNote: All variants are compiled within docker containers, so no variant specific dependencies must be installed.
## Summary
| Language | Compiler | Size (Bytes) | Type | Status | Notes |
|-----------|------|------|------|------|-------|
| [ADA](./ada) | gnat | 1080256 | statically linked | OK | |
| [x86 Assembler](./asm) | gasm | 776 | statically linked | OK | |
| [C](./c) | gcc |967264 | statically linked | OK | |
| [C++](./cpp) | g++ | 2249328 | statically linked | OK | |
| [D](./d) | DMD | | | BROKEN | problems with static linking, PIC and PIE, seg faults |
| [Fortran](./fortran) | gfortran | 1096488 | statically linked | OK | |
| [Golang](./go) | (standard) | 1997487 | statically linked | OK | |
| [Haskell](./haskell) | (standard) | 2363384 | statically linked | OK | |
| [Java](./java-gcj) | gcj | | | NO CHANCE | gcj is dead; seems that libgcj.a has never been delivered |
| [Java](./java-graalvm) | graalvm | 8074624 | statically linked | OK | |
| [Lisp](./lisp) | sbcl | | | BROKEN | doesn't link statically, yet |
| [Nim](./nim) | (standard) | 957808 | statically linked | OK |
| [Ocaml](./ocaml) | ocaml | 1795392 | statically linked | OK | |
| [Pascal](./pascal) | freepascal | 176424 | statically linked | OK | |
| [Rust](./rust) | (standard) | 1931280 | statically linked | OK | |## Usage
```
for variant in ada asm c cpp fortran go haskell java-graalvm nim ocaml pascal rust; do cd ${variant}; make run; cd -; done
```## License
[MIT](./license.txt)