generated from par-tec/python-cookiecutter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.yaml
45 lines (44 loc) · 1.18 KB
/
build.yaml
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
# A kubernetes Job that builds a Docker image based on python:3.12 using buildah
apiVersion: batch/v1
kind: Job
metadata:
name: build-python-image
spec:
backoffLimit: 4
template:
spec:
initContainers:
- name: git-sync
image: alpine/git
command: ["git", "clone", "--depth", "1", "https://github.com/par-tec/argocd-task.git", "/app"]
volumeMounts:
- name: dockerfile
mountPath: /app
containers:
- name: build-python-image
image: quay.io/buildah/stable:latest
command: ['sh', '-c', 'buildah bud -t my-python-image:latest .']
volumeMounts:
- name: varlibcontainers
mountPath: /var/lib/containers
- name: dockerfile
mountPath: "/app"
restartPolicy: Never
volumes:
- name: varlibcontainers
emptyDir: {}
- name: dockerfile
emptyDir: {}
---
# A configmap with a script
# that:
# - clone a remote git repository
# - build a Docker image based on python:3.12 using buildah
apiVersion: v1
kind: ConfigMap
metadata:
name: build-python-image-script
data:
build-python-image.sh: |
#!/bin/sh
buildah bud -t my-python-image:latest .