This commit is contained in:
parent
466c9ef7be
commit
a8d4b11132
3 changed files with 73 additions and 45 deletions
49
builder.sh
Executable file
49
builder.sh
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env bash
|
||||
set -x
|
||||
|
||||
YQ_VERSION=v4.44.2
|
||||
NODE_VERSION=22.15.1
|
||||
PNPM_VERSION=v9.5.0
|
||||
NODE_VERSION=22.x
|
||||
|
||||
ctr=$(buildah from "docker.io/library/debian:trixie-20250428")
|
||||
#mnt=$(buildah mount $ctr)
|
||||
|
||||
buildah run $ctr -- apt-get install -y --no-install-recommends \
|
||||
buildah \
|
||||
curl \
|
||||
git \
|
||||
openssh-client \
|
||||
;
|
||||
#ca-certificates \
|
||||
#gpg \
|
||||
|
||||
# yq https://github.com/mikefarah/yq?tab=readme-ov-file#install
|
||||
buildah run $ctr -- sh -c 'curl --silent --location "https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/yq_linux_amd64.tar.gz" \
|
||||
| tar --extract --gzip --to-stdout ./yq_linux_amd64 \
|
||||
| install --owner=root --group=root --mode=0755 /dev/stdin $mnt/usr/local/bin/yq \
|
||||
;'
|
||||
|
||||
# node https://github.com/nodesource/distributions?tab=readme-ov-file#using-debian-as-root-nodejs-22
|
||||
buildah run $ctr -- sh -c 'curl --silent --location "https://deb.nodesource.com/setup_$NODE_VERSION" | bash'
|
||||
buildah run $ctr -- apt-get install -y --no-install-recommends nodejs
|
||||
# pnpm https://nodejs.org/api/corepack.html#upgrading-the-global-versions
|
||||
buildah run $ctr -- corepack install --global pnpm@$PNPM_VERSION
|
||||
buildah run $ctr -- corepack enable pnpm
|
||||
# Clear caches
|
||||
buildah run $ctr rm -rf /var/lib/apt/lists/*
|
||||
|
||||
buildah commit --rm $ctr $1
|
||||
if [[ $2 ]]; do
|
||||
builda tag "$@"
|
||||
fi
|
||||
|
||||
for image in "$@"; do
|
||||
buildah push $image
|
||||
done
|
||||
|
||||
# apt-get install -y --no-install-recommends \
|
||||
# ca-certificates \
|
||||
## gpg \
|
||||
# ; \
|
||||
# rm -rf /var/lib/apt/lists/*
|
Loading…
Add table
Add a link
Reference in a new issue