https://github.com/umkus/docker-scratch
Minimum viable Docker image
https://github.com/umkus/docker-scratch
docker scratch
Last synced: 3 months ago
JSON representation
Minimum viable Docker image
- Host: GitHub
- URL: https://github.com/umkus/docker-scratch
- Owner: Umkus
- Created: 2017-03-09T17:30:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T12:35:30.000Z (over 9 years ago)
- Last Synced: 2025-01-28T11:48:00.245Z (over 1 year ago)
- Topics: docker, scratch
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker scratch image
Minimum viable Docker image(428 bytes compressed).
Allows you to distribute your code in a slim docker image artifact, separate from the execution environment.
# Why?
It's convenient in case you package your software into minimalistic data-images, that don't actually being run, but
instead expose their content via `volumes_from` (after the container is created from it). This way you can version your software independently from 3rd party dependencies.
The only difference from the Docker Hub's native `scratch` image is addition of an empty (<1kb) linux binary that always returns `0` (`/bin/true`).
It is set as image's entrypoint, so it's always safe to run the resulted image and to create container out of it. Without explicitly defining a command or entrypoint.
# Usage
Use it just as you would use the native scratch image.
Consider the following usage snippets:
### Dockerfile
```
FROM umkus/scratch
COPY . /var/www/
VOLUME /var/www/
```
### Building
```bash
$ docker build -t repo/app --squash .
```
### Docker compose
```yaml
version: '2'
services:
fpm:
image: php
volumes_from:
- code
entrypoint: php bin/console -vvv
code:
image: repo/app
```