mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Only build one awx image instead of separate web and task images
This commit is contained in:
@@ -84,13 +84,9 @@
|
||||
set_fact:
|
||||
docker_base_path: "{{ awx_local_base_config_path|default('/tmp') }}/docker-image"
|
||||
|
||||
- name: Set awx_web image name
|
||||
- name: Set awx image name
|
||||
set_fact:
|
||||
web_image: "{{ web_image|default('awx_web') }}"
|
||||
|
||||
- name: Set awx_task image name
|
||||
set_fact:
|
||||
task_image: "{{ task_image|default('awx_task') }}"
|
||||
awx_image: "{{ awx_image|default('awx') }}"
|
||||
|
||||
- name: Ensure directory exists
|
||||
file:
|
||||
@@ -110,12 +106,6 @@
|
||||
dest: "{{ docker_base_path }}/Dockerfile"
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Template task Dockerfile
|
||||
template:
|
||||
src: Dockerfile.task.j2
|
||||
dest: "{{ docker_base_path }}/Dockerfile.task"
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Stage launch_awx
|
||||
copy:
|
||||
src: launch_awx.sh
|
||||
@@ -174,7 +164,7 @@
|
||||
dest: "{{ docker_base_path }}/Makefile"
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Build base web image
|
||||
- name: Build base awx image
|
||||
docker_image:
|
||||
build:
|
||||
path: "{{ docker_base_path }}"
|
||||
@@ -184,34 +174,17 @@
|
||||
http_proxy: "{{ http_proxy | default('') }}"
|
||||
https_proxy: "{{ https_proxy | default('') }}"
|
||||
no_proxy: "{{ no_proxy | default('') }}"
|
||||
name: "{{ web_image }}"
|
||||
name: "{{ awx_image }}"
|
||||
tag: "{{ awx_version }}"
|
||||
source: 'build'
|
||||
force_source: true
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Build base task image
|
||||
docker_image:
|
||||
build:
|
||||
path: "{{ docker_base_path }}"
|
||||
dockerfile: Dockerfile.task
|
||||
pull: false
|
||||
args:
|
||||
http_proxy: "{{ http_proxy | default('') }}"
|
||||
https_proxy: "{{ https_proxy | default('') }}"
|
||||
no_proxy: "{{ no_proxy | default('') }}"
|
||||
name: "{{ task_image }}"
|
||||
tag: "{{ awx_version }}"
|
||||
source: 'build'
|
||||
force_source: true
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Tag task and web images as latest
|
||||
- name: Tag awx images as latest
|
||||
command: "docker tag {{ item }}:{{ awx_version }} {{ item }}:latest"
|
||||
delegate_to: localhost
|
||||
with_items:
|
||||
- "{{ task_image }}"
|
||||
- "{{ web_image }}"
|
||||
- "{{ awx_image }}"
|
||||
|
||||
- name: Clean docker base directory
|
||||
file:
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
FROM {{ web_image }}:{{ awx_version }}
|
||||
USER 0
|
||||
RUN sudo dnf -y remove nginx
|
||||
USER 1000
|
||||
EXPOSE 8052
|
||||
CMD /usr/bin/launch_awx_task.sh
|
||||
Reference in New Issue
Block a user