1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00
awx/tools/docker-compose/Dockerfile

140 lines
4.0 KiB
Docker
Raw Normal View History

2019-10-29 23:10:51 +03:00
FROM centos:8
2018-10-09 20:59:46 +03:00
ARG UID=0
# Add ansible-devel so that we get collections!
ADD tools/docker-compose/ansible_nightly.repo /etc/yum.repos.d/ansible_nightly.repo
# sync with installer/roles/image_build/templates/Dockerfile.j2
2019-10-29 23:10:51 +03:00
RUN dnf -y update && \
dnf -y install epel-release 'dnf-command(config-manager)' && \
dnf module -y enable 'postgresql:10' && \
dnf config-manager --set-enabled PowerTools && \
dnf -y install acl \
ansible \
bubblewrap \
curl \
gcc \
gcc-c++ \
git-core \
krb5-workstation \
libcurl-devel \
libffi-devel \
libstdc++.so.6 \
libtool-ltdl-devel \
libcgroup-tools \
make \
mercurial \
nginx \
nodejs \
2019-10-29 23:10:51 +03:00
nss \
openldap-devel \
openssh-server \
patch \
2019-10-29 23:10:51 +03:00
@postgresql:10 \
postgresql-devel \
python3-devel \
python3-libselinux \
python3-pip \
python3-psycopg2 \
2019-10-29 23:10:51 +03:00
python3-setuptools \
rsync \
subversion \
sudo \
swig \
tmux \
unzip \
vim-minimal \
xmlsec1 \
xmlsec1-devel \
xmlsec1-openssl \
xmlsec1-openssl-devel \
dnf-utils && \
# UI tests only, do not put in installer/roles/image_build/templates/Dockerfile.j2
dnf -y install \
gtk3 \
alsa-lib \
libX11-xcb \
libXScrnSaver
2018-10-09 20:59:46 +03:00
2019-09-16 17:40:39 +03:00
ENV PATH="/usr/pgsql-10/bin:${PATH}"
2019-10-29 23:10:51 +03:00
RUN dnf 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
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
ADD tools/docker-compose/awx.egg-link /tmp/awx.egg-link
ADD tools/docker-compose/awx-manage /usr/local/bin/awx-manage
ADD tools/docker-compose/awx.egg-info /tmp/awx.egg-info
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-10-29 23:10:51 +03:00
RUN pip3 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-09-16 17:40:39 +03:00
RUN cd /tmp && VENV_BASE="/venv" make requirements_dev
# Use the distro provided npm to bootstrap our required version of node
RUN npm install -g n
RUN n 10.15.0
# Install OpenShift CLI
RUN cd /usr/local/bin && \
curl -L https://github.com/openshift/origin/releases/download/v3.9.0/openshift-origin-client-tools-v3.9.0-191fece-linux-64bit.tar.gz | \
tar -xz --strip-components=1 --wildcards --no-anchored 'oc'
ADD tools/docker-compose/google-cloud-sdk.repo /etc/yum.repos.d/
2019-10-29 23:10:51 +03:00
RUN dnf install -y kubectl
RUN dnf -y remove *-devel \
gcc \
gcc-c++ \
nodejs
2019-10-29 23:10:51 +03:00
RUN dnf -y clean all
RUN rm -rf /root/.cache
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
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
2016-10-18 18:16:38 +03:00
EXPOSE 8043 8013 8080 22
ADD tools/docker-compose/entrypoint.sh /
2019-09-16 17:40:39 +03:00
ADD tools/scripts/awx-python /usr/bin/awx-python
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]
2018-10-09 20:59:46 +03:00
# Pre-create things that we need to write to
RUN for dir in /var/lib/awx/ /var/log/tower/ /projects /.ansible /var/log/nginx /var/lib/nginx /.local; \
do mkdir -p $dir; chmod -R g+rwx $dir; chgrp -R root $dir; done
2018-10-09 20:59:46 +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; \
do touch $file; chmod -R g+rwx $file; chgrp -R root $file; done
2019-05-22 02:15:21 +03:00
ENV HOME /var/lib/awx
ENV PATH=/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin