-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
47 lines (38 loc) · 1.72 KB
/
justfile
File metadata and controls
47 lines (38 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Multi-architecture Docker build orchestration for modware-annotation
# Variables - customize these as needed
name := "modware-annotation"
namespace := "ghcr.io/dictybase"
tag := "latest"
dockerfile := "build/package/Dockerfile.multiarch"
platforms := "linux/amd64,linux/arm64"
# Full image reference
image := namespace + "/" + name + ":" + tag
# List all available recipes
default:
@just --list
# Create and activate the multiarch buildx builder (safe to run multiple times)
setup-buildx:
#!/usr/bin/env sh
if docker buildx inspect multiarch >/dev/null 2>&1; then \
echo "Builder 'multiarch' already exists, setting as active..."; \
docker buildx use multiarch; \
else \
echo "Creating builder 'multiarch'..."; \
docker buildx create --name multiarch --use; \
fi
docker buildx inspect --bootstrap
# Run Go tests before building
test:
gotestsum --format-hide-empty-pkg --format testdox --format-icons hivis
# Build multi-architecture images for all platforms
build-multiarch image_tag=tag:
docker buildx build --platform {{platforms}} -t {{namespace}}/{{name}}:{{image_tag}} -f {{dockerfile}} .
# Build amd64 image only for quick local testing
build-amd64 image_tag=tag:
docker buildx build --platform linux/amd64 -t {{namespace}}/{{name}}:{{image_tag}} -f {{dockerfile}} --load .
# Build arm64 image only for quick local testing
build-arm64 image_tag=tag:
docker buildx build --platform linux/arm64 -t {{namespace}}/{{name}}:{{image_tag}} -f {{dockerfile}} --load .
# Tag and push multi-architecture images to GitHub Container Registry
push-ghcr image_tag=tag:
docker buildx build --platform {{platforms}} -t {{namespace}}/{{name}}:{{image_tag}} -f {{dockerfile}} --push .