-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (129 loc) · 4.8 KB
/
build-docker.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: build-docker-images
on:
push:
branches: [ "main" ]
paths-ignore: [ "*.md" ]
pull_request:
branches: [ "main" ]
paths-ignore: [ "*.md" ]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
env:
BUILDKIT_PROGRESS: "plain" # Full logs for CI build.
REGISTRY_URL: "docker.io" # docker.io or other target registry URL: where to push images to.
REGISTRY_SRC: "docker.io" # For BASE_NAMESPACE of images: where to pull base images from.
# DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD is required for docker image push, they should be set in CI secrets.
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
# used to sync image to mirror registry
DOCKER_MIRROR_REGISTRY_USERNAME: ${{ secrets.DOCKER_MIRROR_REGISTRY_USERNAME }}
DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }}
jobs:
## Clash
docker_clash:
name: 'app-clash'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && build_image app-clash latest docker_app_clash/clash.Dockerfile && push_image
## Casdoor
docker_casdoor:
name: 'casdoor'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && build_image casdoor latest docker_casdoor/Dockerfile && push_image
## Keycloak
docker_keycloak:
name: 'keycloak'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && build_image keycloak latest docker_keycloak/Dockerfile && push_image
## DevHub
qpod_dev-hub:
name: 'dev-hub'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image dev-hub latest docker_devbox/hub.Dockerfile \
--build-arg "BASE_IMG=node" \
--build-arg "ARG_PROFILE_JUPYTER=hub"
push_image
## OpenResty as gateway
qpod_openresty:
name: 'openresty'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && build_image openresty latest docker_openresty/Dockerfile && push_image
## DevBox - base
qpod_base-dev:
name: 'developer,base-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && free_diskspace
build_image base-dev latest docker_devbox/dev.Dockerfile \
--build-arg "BASE_IMG=node" \
--build-arg "ARG_PROFILE_JUPYTER=base,kernels,extensions" \
--build-arg "ARG_PROFILE_VSCODE=base"
alias_image base-dev latest developer latest && push_image dev
## DevBox - data science stack
qpod_data-science-dev:
name: 'data-science-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && free_diskspace
build_image data-science-dev latest docker_devbox/dev.Dockerfile \
--build-arg "BASE_IMG=data-science-stack" \
--build-arg "ARG_PROFILE_JUPYTER=base,kernels,extensions" \
--build-arg "ARG_PROFILE_VSCODE=base" \
--build-arg "ARG_PROFILE_R=rstudio,rshiny"
push_image
## DevBox - full stack
qpod_full-stack-dev:
name: 'full-stack-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && free_diskspace
build_image full-stack-dev latest docker_devbox/dev.Dockerfile \
--build-arg "BASE_IMG=full-stack" \
--build-arg "ARG_PROFILE_JUPYTER=base,kernels,extensions" \
--build-arg "ARG_PROFILE_VSCODE=base" \
--build-arg "ARG_PROFILE_R=rstudio,rshiny"
push_image
## DevBox - cuda
qpod_cuda-dev:
name: 'full-cuda,cuda-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && free_diskspace
build_image cuda-dev latest docker_devbox/dev.Dockerfile \
--build-arg "BASE_IMG=core-cuda" \
--build-arg "ARG_PROFILE_JUPYTER=base,kernels,extensions" \
--build-arg "ARG_PROFILE_VSCODE=base"
alias_image cuda-dev latest full-cuda latest && push_image
## Sync all images in this build (listed by "names") to mirror registry.
sync_images:
needs: ["qpod_cuda-dev", "qpod_data-science-dev", "qpod_full-stack-dev"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
printenv | sort > /tmp/docker.env
docker run --rm --env-file /tmp/docker.env -v $(pwd):/tmp -w /tmp ${IMG_NAMESPACE:-qpod}/docker-kit \
bash -c 'printenv | sort && python /opt/utils/image-syncer/run_jobs.py'