From a1bd84af5e95bd6e5459c7ba1be759b443b211ea Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Sun, 10 Sep 2017 18:54:21 -0400 Subject: [PATCH] Build sdist inside of a container A lot of people have experienced issues with the system-level dependencies that are required in order to build the source distribution that is handed off to the image builds. This makes it unnecessary to install any additional software on the host machine aside from Ansible and Docker. --- installer/image_build/files/Dockerfile.sdist | 20 ++++++++++++++++++++ installer/image_build/tasks/main.yml | 20 +++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 installer/image_build/files/Dockerfile.sdist diff --git a/installer/image_build/files/Dockerfile.sdist b/installer/image_build/files/Dockerfile.sdist new file mode 100644 index 0000000000..15d0749f15 --- /dev/null +++ b/installer/image_build/files/Dockerfile.sdist @@ -0,0 +1,20 @@ +FROM centos:7 + +RUN yum install -y epel-release + +RUN yum install -y bzip2 \ + gcc-c++ \ + gettext \ + git \ + make \ + python \ + python-pip + +RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - +RUN yum install -y nodejs +RUN npm set progress=false + +WORKDIR "/awx" + +ENTRYPOINT ["/bin/bash", "-c"] +CMD ["make sdist"] diff --git a/installer/image_build/tasks/main.yml b/installer/image_build/tasks/main.yml index 45a9879623..b6c41fc97b 100644 --- a/installer/image_build/tasks/main.yml +++ b/installer/image_build/tasks/main.yml @@ -47,12 +47,22 @@ when: not sdist.stat.exists delegate_to: localhost +- name: Build sdist builder image + docker_image: + path: "image_build/files" + dockerfile: Dockerfile.sdist + name: awx_sdist_builder + tag: "{{ awx_version }}" + force: true + - name: Build AWX distribution - shell: make sdist - args: - chdir: .. - creates: "./dist/{{ awx_sdist_file }}" - delegate_to: localhost + docker_container: + image: "awx_sdist_builder:{{ awx_version }}" + name: awx_sdist_builder + state: started + detach: false + volumes: + - ../:/awx - name: Set docker build base path set_fact: