-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathbuild_container.yaml
More file actions
39 lines (37 loc) · 1.24 KB
/
build_container.yaml
File metadata and controls
39 lines (37 loc) · 1.24 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
# Ansible playbook to create the pulp service containers image
---
- name: "Build CI Container Image"
hosts: "localhost"
gather_facts: false
vars_files:
- "vars/main.yaml"
tasks:
- name: "Generate Containerfile from template"
ansible.builtin.template:
src: "Containerfile.j2"
dest: "Containerfile"
- name: "Build pulp image"
# We build from the ../.. (parent dir of pulpcore git repo) Docker build
# "context" so that repos like pulp-smash are accessible to Docker
# build. So that PR branches can be used via relative paths.
#
# We default to using the docker build / podman buildah cache, for
# 1-off-builds and CI purposes (which has no cache across CI runs.)
# Run build.yaml with -e cache=false if your builds are using outdated
# layers.
ansible.builtin.command:
argv:
- "docker"
- "build"
- "--network"
- "host"
- "--no-cache={{ not cache | default(true) | bool }}"
- "-t"
- "{{ image.name }}:{{ image.tag }}"
- "-f"
- "{{ playbook_dir }}/Containerfile"
- "../../.."
- name: "Clean image cache"
community.docker.docker_prune:
images: true
...