GoogleContainerTools/distroless

Name: distroless

Owner: Google Cloud Platform

Owner: GoogleContainerTools

Description: ? Language focused docker images, minus the operating system.

Created: 2017-04-18 22:02:38.0

Updated: 2018-05-24 14:20:10.0

Pushed: 2018-05-21 18:13:15.0

Homepage:

Size: 178

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

“Distroless” Docker Images

Build Status

“Distroless” images contain only your application and its runtime dependencies. They do not contain package managers, shells or any other programs you would expect to find in a standard Linux distribution.

For more information, see this talk (video).

Why should I use distroless images?

Restricting what's in your runtime container to precisely what's necessary for your app is a best practice employed by Google and other tech giants that have used containers in production for many years. It improves the signal to noise of scanners (e.g. CVE) and reduces the burden of establishing provenance to just what you need.

How do I use distroless images?

These images are built using the bazel tool, but they can also be used through other Docker image build tooling.

Docker

Docker multi-stage builds make using distroless images easy. Follow these steps to get started:

Examples with Docker

Here's a quick example for go:

Start by building the application.
OM golang:1.8 as build

RKDIR /go/src/app
PY . .

N go-wrapper download   # "go get -d -v ./..."
N go-wrapper install

Now copy it into our base image.
OM gcr.io/distroless/base
PY --from=build /go/bin/app /
D ["/app"]

You can find other examples here:

To run any example, go the the directory for the language and run

er build -t myapp .
er run -t myapp
Bazel

For full documentation on how to use bazel to generate Docker images, see the bazelbuild/rules_docker repository.

For documentation and examples on how to use the bazel package manager rules, see ./package_manager

Examples can be found in this repository in the examples directory.

Examples with Bazel

We have some examples on how to run some common application stacks in the /examples directory. See here for:

See here for examples on how to complete some common tasks in your image:

See here for more information on how these images are built and released.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.