跳至正文
Wener Notes

earthly

约 1 分钟阅读
    • Makefile + Dockerfile = Earthfile
bash
# macOS
brew install earthly/earthly/earthly && earthly bootstrap
# macOS manual
curl -LO https://github.com/earthly/earthly/releases/download/v0.5.24/earthly-darwin-amd64
chmod +x earthly-darwin-amd64
mv earthly-darwin-amd64 ~/go/bin/earthly

earthly +docker
docker
FROM golang:alpine
WORKDIR /go-example

deps:
    COPY go.mod go.sum ./
    RUN go mod download
    # Output these back in case go mod download changes them.
    SAVE ARTIFACT go.mod AS LOCAL go.mod
    SAVE ARTIFACT go.sum AS LOCAL go.sum

build:
    FROM +deps
    COPY main.go .
    RUN go build -o build/go-example main.go
    SAVE ARTIFACT build/go-example /go-example AS LOCAL build/go-example

docker:
    COPY +build/go-example .
    ENTRYPOINT ["/go-example/go-example"]
    SAVE IMAGE go-example:latest

~/.earthly/config.yml

yaml
global:
  # ~/.earthly/install_id
  disable_analytics: true

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub1 条
其他外链1 条
最近更新commit e9397d7编辑