2019-07-16 16:18:24 +03:00
FROM centos:7
2015-09-10 00:16:35 +03:00
2018-10-09 20:59:46 +03:00
ARG UID = 0
2019-07-18 18:26:12 +03:00
# Add ansible-devel so that we get collections!
ADD tools/docker-compose/ansible_nightly.repo /etc/yum.repos.d/ansible_nightly.repo
2019-05-24 23:30:06 +03:00
# add rhscl repo for rh-postgresql-devel
RUN yum -y install centos-release-scl
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN yum -y update && yum -y install epel-release && yum -y install https://centos7.iuscommunity.org/ius-release.rpm
2019-07-16 16:18:24 +03:00
2019-04-18 23:50:38 +03:00
# sync with installer/roles/image_build/templates/Dockerfile.j2
2019-07-16 16:18:24 +03:00
RUN yum -y install acl \
2019-05-22 02:15:21 +03:00
alsa-lib \
2019-05-08 20:26:34 +03:00
ansible \
2019-05-22 02:15:21 +03:00
atk \
2019-05-08 20:26:34 +03:00
bubblewrap \
2019-05-22 02:15:21 +03:00
cups-libs \
2019-05-08 20:26:34 +03:00
curl \
cyrus-sasl \
cyrus-sasl-devel \
gcc \
gcc-c++ \
2019-05-22 02:15:21 +03:00
GConf2 \
2019-07-22 22:14:39 +03:00
git2u \
git2u-core \
2019-05-22 02:15:21 +03:00
gtk3 \
ipa-gothic-fonts \
2019-05-08 20:26:34 +03:00
krb5-devel \
krb5-libs \
krb5-workstation \
libcurl-devel \
libffi-devel \
libselinux-python \
libstdc++.so.6 \
libtool-ltdl-devel \
2019-05-22 02:15:21 +03:00
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXi \
2019-05-08 20:26:34 +03:00
libxml2-devel \
2019-05-22 02:15:21 +03:00
libXrandr \
libXScrnSaver \
2019-05-08 20:26:34 +03:00
libxslt-devel \
2019-05-22 02:15:21 +03:00
libXtst \
2019-05-08 20:26:34 +03:00
make \
mercurial \
mg \
nginx \
nodejs \
openldap-devel \
openssh-server \
2019-08-01 17:26:15 +03:00
patch \
2019-05-24 23:30:06 +03:00
rh-postgresql10-postgresql-devel \
rh-postgresql10-postgresql-server-syspaths \
scl-utils-build \
scl-utils \
2019-05-08 20:26:34 +03:00
python-devel \
python-pip \
python-psutil \
python-psycopg2 \
python-setuptools \
2019-07-16 16:18:24 +03:00
python36-devel \
python36-setuptools \
2019-05-08 20:26:34 +03:00
rsync \
2019-07-16 16:18:24 +03:00
setools-libs \
2019-05-08 20:26:34 +03:00
subversion \
sudo \
swig \
tmux \
unzip \
vim \
xmlsec1 \
xmlsec1-devel \
xmlsec1-openssl \
xmlsec1-openssl-devel \
2019-05-22 02:15:21 +03:00
xorg-x11-fonts-100dpi \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-cyrillic \
xorg-x11-fonts-misc \
xorg-x11-fonts-Type1 \
xorg-x11-utils \
2019-05-08 20:26:34 +03:00
yum-utils
2018-10-09 20:59:46 +03:00
2019-06-03 23:03:51 +03:00
RUN yum install -y https://github.com/krallin/tini/releases/download/v0.18.0/tini_0.18.0.rpm
2018-10-09 20:59:46 +03:00
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
2018-10-09 20:59:46 +03:00
2019-05-24 23:30:06 +03:00
# symlink python interpreter
RUN ln -s /awx_devel/tools/scripts/awx-python /usr/bin/awx-python
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
2019-05-08 20:26:34 +03:00
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
2018-10-09 20:59:46 +03:00
2019-05-22 02:15:21 +03:00
RUN python3 -m ensurepip && pip3 install virtualenv flake8
2019-05-08 20:26:34 +03:00
RUN pip install supervisor
ADD Makefile /tmp/Makefile
RUN mkdir /tmp/requirements
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/
2018-10-09 20:59:46 +03:00
RUN mkdir -p /venv && chmod g+w /venv
2019-05-24 23:30:06 +03:00
RUN scl enable rh-postgresql10 "" "cd /tmp && VENV_BASE=" /venv" make requirements_dev" ""
2019-05-08 20:26:34 +03:00
# Use the distro provided npm to bootstrap our required version of node
RUN npm install -g n
2019-05-29 19:47:06 +03:00
RUN n 10.15.0
2019-05-08 20:26:34 +03:00
2019-07-16 16:57:31 +03:00
# Install a newer SQLite to make Django happy (centos7 has a really old one,
# and we can probably stop doing this in centos8)
RUN curl -O "https://sqlite.org/2019/sqlite-autoconf-3290000.tar.gz"
RUN tar zxvf sqlite-autoconf-3290000.tar.gz
RUN cd sqlite-autoconf-3290000 && ./configure && make && make install
RUN mv -f /usr/local/lib/libsqlite3.so.0 /lib64/
RUN mv -f /usr/local/lib/libsqlite3.so.0.8.6 /lib64/
2019-05-08 20:26:34 +03:00
RUN yum -y remove cyrus-sasl-devel \
gcc \
gcc-c++ \
krb5-devel \
libtool-ltdl-devel \
libxml2-devel \
libxslt-devel \
openldap-devel \
2019-05-24 23:30:06 +03:00
rh-postgresql10-postgresql-devel \
2019-05-08 20:26:34 +03:00
python-devel \
python36-devel \
nodejs \
xmlsec1-devel \
xmlsec1-openssl-devel
2019-04-18 23:50:38 +03:00
RUN yum -y clean all
2019-05-08 20:26:34 +03:00
2019-04-18 23:50:38 +03:00
RUN rm -rf /root/.cache
2019-05-08 20:26:34 +03:00
2019-05-24 23:30:06 +03:00
# makes postgres available for data migrations when upgrading
RUN export PATH = /usr/pgsql-10/bin:$PATH
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
2019-05-08 20:26:34 +03:00
2019-05-10 17:14:51 +03:00
ADD tools/docker-compose/nginx.conf /etc/nginx/nginx.conf
ADD tools/docker-compose/nginx.vh.default.conf /etc/nginx/conf.d/nginx.vh.default.conf
ADD tools/docker-compose/start_development.sh /start_development.sh
ADD tools/docker-compose/start_tests.sh /start_tests.sh
ADD tools/docker-compose/bootstrap_development.sh /bootstrap_development.sh
2019-05-08 20:26:34 +03:00
2016-10-18 18:16:38 +03:00
EXPOSE 8043 8013 8080 22
2019-05-08 20:26:34 +03:00
2019-05-10 17:14:51 +03:00
ADD tools/docker-compose/entrypoint.sh /
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "/bin/bash" ]
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
2019-05-22 02:15:21 +03:00
2019-07-26 20:15:53 +03:00
ENV HOME /var/lib/awx
2019-05-29 19:47:06 +03:00
ENV PATH = /usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin