This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.dist.yml
68 lines (61 loc) · 1.7 KB
/
Taskfile.dist.yml
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
60
61
62
63
64
65
66
67
68
version: "3"
silent: true
vars:
DOCKER_REPO: ghcr.io
DOCKER_OWNER: ilyes512
DOCKER_IMAGE_NAME: php83-fpm
# Latatest version of Hadolint: https://hub.docker.com/r/hadolint/hadolint/tags or https://github.com/hadolint/hadolint/releases
HADOLINT_TAG_VERSION: v2.12.0
tasks:
build:
desc: Build all PHP Docker image targets
cmds:
- task: build:target
vars:
TARGET: runtime
- task: build:target
vars:
TARGET: builder
- task: build:target
vars:
TARGET: builder_nodejs
- task: build:target
vars:
TARGET: vscode
build:target:
deps: [lint]
preconditions:
- sh: >
test '{{.TARGET}}' = 'runtime'
-o '{{.TARGET}}' = 'builder'
-o '{{.TARGET}}' = 'builder_nodejs'
-o '{{.TARGET}}' = 'vscode'
msg: TARGET needs to contain the Docker TARGET [runtime, builder, builder_nodejs, vscode]
vars:
VERSION: '{{.VERSION | default "latest"}}'
cmds:
- docker build
--target {{.TARGET}}
--tag {{.DOCKER_REPO}}/{{.DOCKER_OWNER}}/{{.DOCKER_IMAGE_NAME}}:{{.TARGET}}-{{.VERSION}}
.
lint:
desc: Apply a Dockerfile linter (https://github.com/hadolint/hadolint)
cmds:
- docker run
--interactive
--rm
--volume $(pwd)/.hadolint.yml:/.hadolint.yml
hadolint/hadolint:{{.HADOLINT_TAG_VERSION}}
hadolint
-
< Dockerfile
shell:
desc: Interactive shell
interactive: true
cmds:
- docker run
--interactive
--tty
--rm
{{.DOCKER_REPO}}/{{.DOCKER_OWNER}}/{{.DOCKER_IMAGE_NAME}}:builder_nodejs-{{.VERSION | default "latest" }}
bash