https://github.com/paralin/scratchbuild
Intelligently build Docker images from scratch for cross-architecture support.
https://github.com/paralin/scratchbuild
Last synced: 11 months ago
JSON representation
Intelligently build Docker images from scratch for cross-architecture support.
- Host: GitHub
- URL: https://github.com/paralin/scratchbuild
- Owner: paralin
- License: mit
- Created: 2016-05-17T20:44:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-04T16:58:14.000Z (over 1 year ago)
- Last Synced: 2024-10-13T15:07:29.119Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scratch Build
[![GoDoc Widget]][GoDoc] [![Go Report Card Widget]][Go Report Card]
[GoDoc]: https://godoc.org/github.com/paralin/scratchbuild
[GoDoc Widget]: https://godoc.org/github.com/paralin/scratchbuild?status.svg
[Go Report Card Widget]: https://goreportcard.com/badge/github.com/paralin/scratchbuild
[Go Report Card]: https://goreportcard.com/report/github.com/paralin/scratchbuild
## Introduction
Scratch Build is a small CLI tool that can successfully compile **from scratch** the majority of the Docker library images.
Images are built by traversing the Dockerfile stack down to either scratch or a known working alternative for the target architecture, and then working up to the target.
This is VERY useful for rebuilding docker images on non-intel architectures.
## Getting Started
You use `scratchbuild build` just like `docker build`:
```
$ scratchbuild build -t "myname/myimage:latest-arm" -f Dockerfile .
```
Scratch Build will detect your target architecture (customizable with the flags), traverse the stack of `FROM` declarations, make a plan on how to build the container for the target arch, and then execute the plan in stages.
## Build Quirks
Note: you may have some errors when trying to build. In this case, try disabling CGO:
```
CGO_ENABLED=0 go build -v -o scratchbuild github.com/paralin/scratchbuild/cmd/scratchbuild
```