-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuildx.sh
More file actions
executable file
·22 lines (19 loc) · 729 Bytes
/
buildx.sh
File metadata and controls
executable file
·22 lines (19 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
repo="nevinee/python"
arch="linux/amd64,linux/arm64,linux/arm/v7"
buildx() {
docker pull tonistiigi/binfmt
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --name builder --use 2>/dev/null || docker buildx use builder
docker buildx inspect --bootstrap
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform "$arch" \
--tag ${repo}:latest \
--push \
.
docker pushrm $repo # https://github.com/christian-korneck/docker-pushrm
}
[[ ! -d logs ]] && mkdir logs
buildx 2>&1 | ts "[%Y-%m-%d %H:%M:%.S]" | tee -a logs/${ver}.log