-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
58 lines (45 loc) · 1.3 KB
/
justfile
File metadata and controls
58 lines (45 loc) · 1.3 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
48
49
50
51
52
53
54
55
56
57
58
# See https://just.systems/man/en
# load .env
set dotenv-load := true
# set env var
export APP := "compose_image_name"
export SHELL := "/bin/sh"
export TAG := "latest"
# x86_64/arm64
arch := `uname -m`
# hostname
host := `uname -n`
# halp
default:
just --list
# build locally or on intel box
build:
#!/usr/bin/env bash
set -euxo pipefail
# accepts justfile env/vars
if [[ {{arch}} == "arm64" ]]; then
docker build -f Dockerfile -t {{APP}}:{{TAG}} --build-arg CHIPSET_ARCH=aarch64-linux-gnu .
else
docker buildx build -f Dockerfile --progress=plain -t {{APP}}:{{TAG}} --build-arg CHIPSET_ARCH=x86_64-linux-gnu --load .
fi
# intel build
buildx:
docker buildx build -f Dockerfile --progress=plain -t $TAG --build-arg CHIPSET_ARCH=x86_64-linux-gnu --load .
# arm build w/docker-compose defaults
build-clean:
docker-compose build --pull --no-cache --build-arg CHIPSET_ARCH=aarch64-linux-gnu
# pull latest image
pull:
docker pull "{{APP}}:{{TAG}}"
# start docker-compose container
start:
docker-compose up -d
# ssh into container
exec:
docker-compose exec {{APP}} {{SHELL}}
# stop docker-compose container
stop:
docker-compose stop
# remove docker-compose container(s) and networks
down:
docker-compose stop && docker-compose down --remove-orphans