summaryrefslogtreecommitdiff
path: root/roles/apps/collabora/code/instance/tasks/custom-image.yml
blob: 212fff364952bdd7e13dcd34cca0d3829baa502d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
- name: create build directory for custom image
  file:
    path: "{{ collabora_code_instance_basepath }}/build"
    state: directory

- name: generate Dockerfile for custom image
  copy:
    content: |
      FROM {{ collabora_code_instances[collabora_code_instance].custom_image.from | default('collabora/code:' + collabora_code_instances[collabora_code_instance].version) }}
      {{ collabora_code_instances[collabora_code_instance].custom_image.dockerfile }}
    dest: "{{ collabora_code_instance_basepath }}/build/Dockerfile"
  register: collabora_code_custom_image_docker

- name: build custom image
  docker_image:
    name: "collabora/code/{{ collabora_code_instance }}:{{ collabora_code_instances[collabora_code_instance].version }}"
    state: present
    force_source: "{{ collabora_code_custom_image_docker is changed }}"
    source: build
    build:
      path: "{{ collabora_code_instance_basepath }}/build"
      network: host
      pull: yes