summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Jones <matburt@redhat.com>2017-08-22 15:02:32 +0200
committerMatthew Jones <matburt@redhat.com>2017-08-22 19:21:53 +0200
commit6e4d886ea44091aa3892b24006de57e49f7c5152 (patch)
tree2c1e1a3c4f2e78e932353d118128526d4521624e
parentInitial awx installer (diff)
downloadawx-6e4d886ea44091aa3892b24006de57e49f7c5152.tar.xz
awx-6e4d886ea44091aa3892b24006de57e49f7c5152.zip
Reduce the size of the production container image
-rw-r--r--Makefile6
-rw-r--r--installer/image_build/tasks/main.yml2
-rw-r--r--installer/image_build/templates/Dockerfile.j217
3 files changed, 11 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index e2cb881fa3..ec3d5db8a1 100644
--- a/Makefile
+++ b/Makefile
@@ -608,9 +608,3 @@ psql-container:
VERSION:
echo $(VERSION_TARGET) > $@
-production-openshift-image: sdist
- cat installer/openshift/Dockerfile | sed "s/{{ version }}/$(VERSION_TARGET)/g" | sed "s/{{ tar }}/$(SDIST_TAR_FILE)/g" > ./Dockerfile.production
- cp installer/openshift/Dockerfile.celery ./Dockerfile.celery.production
- docker build -t awx_web -f ./Dockerfile.production .
- docker build -t awx_task -f ./Dockerfile.celery.production .
-
diff --git a/installer/image_build/tasks/main.yml b/installer/image_build/tasks/main.yml
index 4358c32313..ab7a31de79 100644
--- a/installer/image_build/tasks/main.yml
+++ b/installer/image_build/tasks/main.yml
@@ -9,7 +9,6 @@
- name: Set global version if not provided
set_fact:
awx_version: "{{ awx_version_command.stdout }}"
- use_local_awx: true
when: awx_version is not defined
- name: Set sdist file name
@@ -26,7 +25,6 @@
chdir: ..
creates: "../dist/{{ awx_sdist_file }}"
delegate_to: localhost
- when: use_local_awx is not defined
- name: Set docker build base path
set_fact:
diff --git a/installer/image_build/templates/Dockerfile.j2 b/installer/image_build/templates/Dockerfile.j2
index 67bbbfea53..ba37539b4c 100644
--- a/installer/image_build/templates/Dockerfile.j2
+++ b/installer/image_build/templates/Dockerfile.j2
@@ -23,15 +23,23 @@ ADD requirements/requirements_ansible.txt \
/tmp/requirements/
# OS Dependencies
-RUN yum -y install epel-release && yum -y localinstall http://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm && yum -y update && yum -y install ansible git curl python-psycopg2 python-pip python-setuptools libselinux-python setools-libs yum-utils sudo acl make postgresql-devel nginx python-psutil libxml2-devel libxslt-devel libstdc++.so.6 gcc cyrus-sasl-devel cyrus-sasl openldap-devel libffi-devel python-pip xmlsec1-devel swig krb5-devel xmlsec1-openssl xmlsec1 xmlsec1-openssl-devel libtool-ltdl-devel bubblewrap gcc-c++ python-devel
-RUN pip install virtualenv supervisor
WORKDIR /tmp
RUN mkdir -p /var/lib/awx/public/static
+RUN chgrp -Rf root /var/lib/awx && chmod -Rf g+w /var/lib/awx
+RUN yum -y install epel-release && \
+ yum -y localinstall http://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm && \
+ yum -y update && \
+ yum -y install ansible git curl python-psycopg2 python-pip python-setuptools libselinux-python setools-libs yum-utils sudo acl make postgresql-devel nginx python-psutil libxml2-devel libxslt-devel libstdc++.so.6 gcc cyrus-sasl-devel cyrus-sasl openldap-devel libffi-devel python-pip xmlsec1-devel swig krb5-devel xmlsec1-openssl xmlsec1 xmlsec1-openssl-devel libtool-ltdl-devel bubblewrap gcc-c++ python-devel && \
+ pip install virtualenv supervisor && \
+ VENV_BASE=/var/lib/awx/venv make requirements_ansible && \
+ VENV_BASE=/var/lib/awx/venv make requirements_awx && \
+ yum -y remove gcc postgresql-devel libxml2-devel libxslt-devel cyrus-sasl-devel openldap-devel xmlsec1-devel krb5-devel xmlsec1-openssl-devel libtool-ltdl-devel gcc-c++ python-devel && \
+ yum -y clean all && \
+ rm -rf /root/.cache
RUN mkdir -p /var/log/tower
RUN mkdir -p /etc/tower
RUN echo "awxsecret" > /etc/tower/SECRET_KEY
-RUN VENV_BASE=/var/lib/awx/venv make requirements_ansible && VENV_BASE=/var/lib/awx/venv make requirements_awx
COPY {{ awx_sdist_file }} /tmp/{{ awx_sdist_file }}
RUN OFFICIAL=yes pip install /tmp/{{ awx_sdist_file }}
@@ -43,10 +51,7 @@ ADD launch_awx.sh /usr/bin/launch_awx.sh
ADD launch_awx_task.sh /usr/bin/launch_awx_task.sh
RUN chmod +rx /usr/bin/launch_awx.sh && chmod +rx /usr/bin/launch_awx_task.sh
ADD settings.py /etc/tower/settings.py
-RUN yum -y remove gcc postgresql-devel libxml2-devel libxslt-devel cyrus-sasl-devel openldap-devel xmlsec1-devel krb5-devel xmlsec1-openssl-devel libtool-ltdl-devel gcc-c++ python-devel && yum -y clean all
-RUN rm -rf /root/.cache
RUN chmod g+w /etc/passwd
-RUN chgrp -Rf root /var/lib/awx && chmod -Rf g+w /var/lib/awx
RUN chmod -R 777 /var/log/nginx && chmod -R 777 /var/lib/nginx
USER 1000
EXPOSE 8052