https://github.com/peter-mount/scratch-base
A minimalistic docker image containing the essential files for static binaries to work with ssl & tzdata
https://github.com/peter-mount/scratch-base
Last synced: 5 months ago
JSON representation
A minimalistic docker image containing the essential files for static binaries to work with ssl & tzdata
- Host: GitHub
- URL: https://github.com/peter-mount/scratch-base
- Owner: peter-mount
- License: apache-2.0
- Created: 2018-06-19T07:40:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T16:16:43.000Z (over 6 years ago)
- Last Synced: 2024-12-06T21:38:39.100Z (over 1 year ago)
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This project is now deprecated
# scratch-base
A base docker image like scratch which contains the essential files/directories
from alpine:latest needed by statically built binaries (e.g. golang) that need
to make https/tls connections or current timezone data.
## Files/Directories included
* /etc/ssl
* /etc/TZ
* /etc/localtime
/tmp is also created with modes 777 & +t so temporary files will also work.
## Usage
In your multipart Dockerfile first compile your binaries then create the final
image with
```
FROM area51/scratch-base
COPY --from=build /src/dir/ /dest/dir/
```
where:
* --from=build defines the alias of your build step image
* /src/dir/ is the source directory in that image to copy
* /dest/dir/ is the destination directory in this image
For example: I build static golang images so in docker I'd use:
```
FROM golang:alpine AS build
RUN mkdir -p /dest/bin
... build steps here, writing the built binaries into /dest/bin
```
Then the final image would be:
```
FROM area51/scratch-base
COPY --from=build /dest/ /
```
The final image would then contain 2 layers, the first from this project and the
second containing just your built binaries.