melange 基于源码构建apk 包的工具
实际上melange是apko 的相关项目,结合起来可以更好的创建基于apk 的oci 镜像,melange 主要是定义了
一套pipeline 可以方便的进行apk 包开发
安装
可以基于docker 运行
go install chainguard.dev/melange@latest
使用
- 配置
package:
name: hello
version: 2.12
epoch: 0
description: "the GNU hello world program"
target-architecture:
- amd64
copyright:
- paths:
- "*"
attestation: |
Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005,
2006, 2007, 2008, 2010, 2011, 2013, 2014, 2022 Free Software Foundation,
Inc.
license: GPL-3.0-or-later
dependencies:
runtime:
environment:
contents:
repositories:
- https://mirrors.aliyun.com/alpine/edge/main
packages:
- alpine-baselayout-data
- busybox
- build-base
- scanelf
- ssl_client
- ca-certificates-bundle
pipeline:
- uses: fetch
with:
uri: https://ftp.gnu.org/gnu/hello/hello-${{package.version}}.tar.gz
expected-sha256: cf04af86dc085268c5f4470fbae49b18afbc221b78096aab842d934a76bad0ab
- uses: autoconf/configure
- uses: autoconf/make
- uses: autoconf/make-install
- uses: strip
- 构建
可以直接基于docker 运行比较方便
docker run --rm --privileged -v "${PWD}":/work \
cgr.dev/chainguard/melange build demo.yaml \
--arch amd64
效果
说明
使用melange 构建apk 包是一个听不错的选择,比较方便
参考资料
https://github.com/chainguard-dev/melange
https://github.com/chainguard-dev/apko
https://github.com/chainguard-dev/melange/blob/main/docs/PIPELINES-GO.md
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2021-04-14 cube.js 通过prepareCompiler获取 meta
2020-04-14 easy-rules spring boot集成使用二
2020-04-14 easy-rules spring boot集成使用
2019-04-14 edgedb 基本试用
2018-04-14 osquery简单试用