GithubHelp home page GithubHelp logo

cbuschka / distrolessdocker Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 1021 KB

Distroless docker container with statically linked binaries in different languages

License: MIT License

Dockerfile 0.67% Makefile 71.60% C 1.42% Go 0.87% Rust 0.50% C++ 1.20% OCaml 0.44% Pascal 0.64% Fortran 0.68% Assembly 7.99% Java 3.04% Common Lisp 0.87% Haskell 0.36% Nim 0.25% Shell 8.29% Ada 1.18%
docker distroless

distrolessdocker's Introduction

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 footprint

Contra:

  • ???

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
  • docker

Note: All variants are compiled within docker containers, so no variant specific dependencies must be installed.

Summary

Language Compiler Size (Bytes) Type Status Notes
ADA gnat 1080256 statically linked OK
x86 Assembler gasm 776 statically linked OK
C gcc 967264 statically linked OK
C++ g++ 2249328 statically linked OK
D DMD BROKEN problems with static linking, PIC and PIE, seg faults
Fortran gfortran 1096488 statically linked OK
Golang (standard) 1997487 statically linked OK
Haskell (standard) 2363384 statically linked OK
Java gcj NO CHANCE gcj is dead; seems that libgcj.a has never been delivered
Java graalvm 8074624 statically linked OK
Lisp sbcl BROKEN doesn't link statically, yet
Nim (standard) 957808 statically linked OK
Ocaml ocaml 1795392 statically linked OK
Pascal freepascal 176424 statically linked OK
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

distrolessdocker's People

Contributors

cbuschka avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

distrolessdocker's Issues

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.