castage

command module
v0.0.0-...-4e768ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 9 Imported by: 0

README

castage

castage is multi-stage builds helper for caching.

Installation

go get -u github.com/orisano/castage/...

How to use

$ cat Dockerfile
FROM golang:1.12-alpine3.9 AS vendor
WORKDIR /var/app/castage
RUN apk add --no-cache git
COPY go.sum go.mod ./
RUN go mod download

FROM golang:1.12-alpine3.9 AS builder

FROM alpine:3.9 AS app

$ castage -i image_name
set -ex
docker pull image_name:vendor-cache || true
docker build -t image_name:vendor-cache --target=vendor --cache-from=image_name:vendor-cache .
docker pull image_name:builder-cache || true
docker build -t image_name:builder-cache --target=builder --cache-from=image_name:vendor-cache,image_name:builder-cache .
docker pull image_name:app-cache || true
docker build -t image_name:app-cache --target=app --cache-from=image_name:vendor-cache,image_name:builder-cache,image_name:app-cache .

Author

Nao Yonashiro (@orisano)

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL