2016-08-24 23:23:47 +03:00
FROM centos:7
2015-09-10 00:16:35 +03:00
2018-10-09 20:59:46 +03:00
ARG UID = 0
2016-08-24 23:23:47 +03:00
ADD Makefile /tmp/Makefile
2018-10-09 20:59:46 +03:00
2016-08-24 23:23:47 +03:00
RUN mkdir /tmp/requirements
2018-10-09 20:59:46 +03:00
2019-04-18 23:50:38 +03:00
RUN yum -y update && yum -y install epel-release
RUN yum -y localinstall https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
# sync with installer/roles/image_build/templates/Dockerfile.j2
RUN yum -y install ansible git mercurial subversion 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 python36-setuptools python36-devel krb5-workstation krb5-libs libcurl-devel rsync unzip
2018-10-09 20:59:46 +03:00
2019-04-18 23:50:38 +03:00
RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
RUN yum -y install nodejs openssh-server tmux vim mg
2018-10-09 20:59:46 +03:00
2019-04-04 17:22:46 +03:00
RUN python3 -m ensurepip
2018-10-22 18:47:39 +03:00
RUN pip3 install virtualenv
2015-09-10 00:16:35 +03:00
RUN /usr/bin/ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
RUN mkdir -p /data/db
2019-05-08 20:10:52 +03:00
RUN pip install supervisor
2018-10-09 20:59:46 +03:00
ADD requirements/requirements.txt \
requirements/requirements_git.txt \
requirements/requirements_ansible.txt \
requirements/requirements_ansible_git.txt \
requirements/requirements_dev.txt \
requirements/requirements_ansible_uninstall.txt \
requirements/requirements_tower_uninstall.txt \
/tmp/requirements/
2017-07-26 17:58:46 +03:00
ADD tools/docker-compose/awx.egg-link /tmp/awx.egg-link
2016-08-24 23:23:47 +03:00
ADD tools/docker-compose/awx-manage /usr/local/bin/awx-manage
2017-07-26 17:58:46 +03:00
ADD tools/docker-compose/awx.egg-info /tmp/awx.egg-info
2017-07-18 18:16:18 +03:00
RUN ln -Ffs /awx_devel/tools/docker-compose/nginx.conf /etc/nginx/nginx.conf
RUN ln -Ffs /awx_devel/tools/docker-compose/nginx.vh.default.conf /etc/nginx/conf.d/nginx.vh.default.conf
RUN ln -s /awx_devel/tools/docker-compose/start_development.sh /start_development.sh
2018-09-24 17:53:55 +03:00
RUN ln -s /awx_devel/tools/docker-compose/start_tests.sh /start_tests.sh
2017-08-09 22:53:25 +03:00
RUN ln -s /awx_devel/tools/docker-compose/bootstrap_development.sh /bootstrap_development.sh
2017-07-18 18:16:18 +03:00
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost"
2016-10-18 18:16:38 +03:00
RUN openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt
2016-08-24 23:23:47 +03:00
WORKDIR /tmp
2018-10-09 20:59:46 +03:00
RUN mkdir -p /venv && chmod g+w /venv
2019-04-18 23:50:38 +03:00
RUN CFLAGS = "-DXMLSEC_NO_SIZE_T" VENV_BASE = "/venv" make requirements_dev
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 python36-devel
RUN yum -y clean all
RUN rm -rf /root/.cache
2017-02-02 23:49:17 +03:00
RUN localedef -c -i en_US -f UTF-8 en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
2017-05-26 18:32:49 +03:00
ADD https://github.com/krallin/tini/releases/download/v0.14.0/tini /tini
RUN chmod +x /tini
2016-08-25 18:57:31 +03:00
WORKDIR /
2016-10-18 18:16:38 +03:00
EXPOSE 8043 8013 8080 22
2017-05-26 18:32:49 +03:00
ENTRYPOINT [ "/tini" , "--" ]
2015-09-10 00:16:35 +03:00
CMD /start_development.sh
2018-10-09 20:59:46 +03:00
2018-10-23 02:02:31 +03:00
# Pre-create things that we need to write to
2019-02-15 22:30:27 +03:00
RUN for dir in /var/lib/awx/ /var/log/tower/ /projects /.ansible /var/log/nginx /var/lib/nginx /.local; \
2018-10-23 02:02:31 +03:00
do mkdir -p $dir ; chmod -R g+rwx $dir ; chgrp -R root $dir ; done
2018-10-09 20:59:46 +03:00
2018-12-04 05:42:19 +03:00
RUN for file in /etc/passwd /etc/supervisord.conf \
2018-10-22 18:47:39 +03:00
/venv/awx/lib/python3.6/site-packages/awx.egg-link /var/run/nginx.pid; \
2018-10-23 02:02:31 +03:00
do touch $file ; chmod -R g+rwx $file ; chgrp -R root $file ; done