Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
jdolitsky / hello-melange-apko-11.txt
Created July 21, 2022 05:03
Secure Your Software Factory with melange and apko
diff output.tar output2.tar && echo "Files identical"
@jdolitsky
jdolitsky / hello-melange-apko-10.txt
Last active July 21, 2022 05:25
Secure Your Software Factory with melange and apko
docker run --rm -v "${PWD}":/work \
distroless.dev/apko build --debug apko.yaml \
factory-demo output.tar -k melange.rsa.pub \
--build-arch amd64,aarch64,armv7
@jdolitsky
jdolitsky / hello-melange-apko-9.yaml
Created July 21, 2022 05:02
Secure Your Software Factory with melange and apko
contents:
repositories:
- https://dl-cdn.alpinelinux.org/alpine/edge/main
- '@local /work/packages'
packages:
- alpine-baselayout-data
- hello-server@local
accounts:
groups:
- groupname: nonroot
@jdolitsky
jdolitsky / hello-melange-apko-8.txt
Created July 21, 2022 05:01
Secure Your Software Factory with melange and apko
$ tree packages/
packages/
├── aarch64
│ ├── APKINDEX.tar.gz
│ └── hello-server-0.1.0-r0.apk
├── armv7
│ ├── APKINDEX.tar.gz
│ └── hello-server-0.1.0-r0.apk
└── x86_64
├── APKINDEX.tar.gz
@jdolitsky
jdolitsky / hello-melange-apko-7.txt
Created July 21, 2022 05:00
Secure Your Software Factory with melange and apko
docker run --rm -v "${PWD}":/work \
--entrypoint sh \
distroless.dev/melange -c \
'cd packages && for d in `find . -type d -mindepth 1`; do \
( \
cd $d && \
apk index -o APKINDEX.tar.gz *.apk && \
melange sign-index --signing-key=../../melange.rsa APKINDEX.tar.gz\
) \
done'
@jdolitsky
jdolitsky / hello-melange-apko-6.txt
Last active September 9, 2022 17:28
Secure Your Software Factory with melange and apko
$ tree packages/
packages/
├── aarch64
│   ├── APKINDEX.tar.gz
│   └── hello-server-0.1.0-r0.apk
├── armv7
│   ├── APKINDEX.tar.gz
│   └── hello-server-0.1.0-r0.apk
└── x86_64
├── APKINDEX.tar.gz
@jdolitsky
jdolitsky / hello-melange-apko-5.txt
Last active September 9, 2022 17:30
Secure Your Software Factory with melange and apko
docker run --rm --privileged -v "${PWD}":/work \
distroless.dev/melange build melange.yaml \
--arch amd64,aarch64,armv7 \
--repository-append packages --signing-key melange.rsa
@jdolitsky
jdolitsky / hello-melange-apko-4.txt
Created July 21, 2022 04:57
Secure Your Software Factory with melange and apko
docker run --rm -v "${PWD}":/work distroless.dev/melange keygen
@jdolitsky
jdolitsky / hello-melange-apko-3.yaml
Created July 21, 2022 04:55
Secure Your Software Factory with melange and apko
package:
name: hello-server
version: 0.1.0
description: friendly little webserver
target-architecture:
- all
copyright:
- license: Apache-2.0
paths:
- "*"
@jdolitsky
jdolitsky / hello-melange-apko-2.go
Created July 21, 2022 04:54
Secure Your Software Factory with melange and apko
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()