Sign inSign up

devalias/tiny-scratch-tools

By devalias

Updated almost 9 years ago

.

Image
0

189

devalias/tiny-scratch-tools repository overview

docker-tiny-scratch-tools

A collection of tiny tools to make life easier when creating Docker FROM scratch containers; by Glenn 'devalias' Grant (@_devalias)

This makes use of Docker's multi-stage builds (available since v17.05).

Usage

Copy the tiny tools for the features you need into your FROM scratch container.

FROM devalias/tiny-scratch-tools AS tiny-tools
# Nothing else required here!

# If you need ca-certificates (for HTTPS/etc), then use this trick.
# If you already use another container like alpine for your build-env, you can grab them from there instead
FROM alpine:edge AS ca-certs
RUN apk add --no-cache ca-certificates
# Nothing else required here!

FROM yourfavourite/baseimage AS build-env
# Do your build environment things here

FROM scratch
COPY --from tiny-tools /sbin/chmx /sbin/chmx                                                # If you need it
COPY --from tiny-tools /sbin/su-exec /sbin/su-exec                                          # If you need it
COPY --from=ca-certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt  # If you need it
# Then copy whatever other things you need from your build-env here

Sizes

# du -sh ./chmx
20.0K ./chmx

# du -sh /sbin/su-exec
12.0K /sbin/su-exec

GitHub

DockerHub

Improvements

Tools

Tag summary

Content type

Image

Digest

Size

14.6 kB

Last updated

almost 9 years ago

docker pull devalias/tiny-scratch-tools