-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
59 lines (47 loc) · 1.4 KB
/
Taskfile.yml
File metadata and controls
59 lines (47 loc) · 1.4 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
59
version: 3
silent: true
dotenv: ['.env']
env:
LOCAL_PLATFORM: '{{.DOCKER_LOCAL_PLATFORM | default "linux/arm64"}}'
PLATFORM: '{{.DOCKER_PLATFORM | default "linux/amd64,linux/arm64"}}'
TAG: '{{.DOCKER_IMAGE_TAG | default "codebarista/octane:latest"}}'
REGISTRY: '{{.DOCKER_REGISTRY | default "docker.io"}}'
tasks:
default: task -l
login:
desc: Log in to the container registry
cmd: docker login {{.REGISTRY}}
build:
desc: Build multi-arch octane image and put out
internal: true
cmds:
- echo "Platform $PLATFORM"
- echo "Tag $TAG"
- docker buildx create --name=container --driver=docker-container --use
- docker buildx build --platform={{.PLATFORM}} -t {{.TAG}} --output={{.OUTPUT}} src
- task: clear
- task: prune
push:
desc: Build and push image to remote registry
cmds:
- task: login
- task: build
vars:
PLATFORM: '{{.PLATFORM}}'
OUTPUT: type=registry --push
load:
desc: Build and load image to local docker
cmds:
- task: build
vars:
PLATFORM: '{{.LOCAL_PLATFORM}}'
OUTPUT: type=docker --load
prune:
desc: Prune dangling images
cmd: docker image prune --force --filter=dangling=true
clear:
desc: Remove buildx container
cmd: docker buildx rm container
run:
desc: Run the octane docker image
cmd: docker run -it --rm {{.TAG}} sh