Create a new base image for addons/olympia.

* Upgrade to Centos 7
* Use gpg-keys for nodesource and mysql56 repositories
* Uses more prod-like package versions
* Update pyrepo links to use https://pyrepo.stage.mozaws.net/olympia/
  (this is what we're using on prod)
This commit is contained in:
Christopher Grebs 2015-11-23 19:36:22 +01:00
Родитель 441ed5f86e
Коммит 96319bde4a
8 изменённых файлов: 177 добавлений и 19 удалений

Просмотреть файл

@ -1,39 +1,60 @@
FROM mozillamarketplace/centos-mysql-mkt:0.2
FROM centos:centos7
# Set the locale. This is mainly so that tests can write non-ascii files to
# disk.
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Fix multilib issues when installing openssl-devel.
RUN yum install -y --enablerepo=centosplus libselinux-devel && yum clean all
ADD docker/mysql-community.gpg.key /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
ADD docker/nodesource.gpg.key /etc/pki/rpm-gpg/RPM-GPG-KEY-nodesource
ADD docker-mysql.repo /etc/yum.repos.d/mysql.repo
# For mysql-python dependencies
ADD docker/mysql.repo /etc/yum.repos.d/mysql.repo
# This is temporary until https://bugzilla.mozilla.org/show_bug.cgi?id=1226533
ADD docker/nodesource.repo /etc/yum.repos.d/nodesource.repo
RUN yum update -y \
&& yum install -y \
# Supervisor is being used to start and keep our services running
supervisor \
# General (dev-) dependencies
bash-completion \
gcc-c++ \
curl \
make \
libjpeg-devel \
cyrus-sasl-devel \
libxml2-devel \
libxslt-devel \
nodejs \
zlib-devel \
mysql-community-libs-compat-5.6.14-3.el6.x86_64 \
libffi-devel \
openssl-devel \
python-devel \
# Git, because we're using git-checkout dependencies
git \
# Nodejs for less, stylus, uglifyjs and others
nodejs \
# Dependencies for mysql-python
mysql-community-devel \
mysql-community-client \
mysql-community-libs \
epel-release \
&& yum clean all
# The version in the above image is ancient, and does not support the
# --no-binary flag used in our requirements files.
# We also need to install wheels.
RUN pip install -U pip wheel
RUN yum install -y python-pip
# Until https://github.com/shazow/urllib3/commit/959d47d926e1331ad571dbfc150c9a3acb7a1eb9 lands
RUN pip install pyOpenSSL ndg-httpsclient pyasn1 certifi urllib3
# ipython / ipdb for easier debugging, supervisor to run services
RUN pip install ipython ipdb supervisor
# Install all python requires
COPY requirements /pip/requirements/
RUN cd /pip && \
pip install --build ./build --cache-dir ./cache \
--find-links https://pyrepo.stage.mozaws.net/ \
--find-links https://pyrepo.stage.mozaws.net/olympia/ \
--no-index --no-deps \
-r requirements/docker.txt && \
rm -r build cache
@ -43,7 +64,6 @@ RUN mkdir -p /srv/olympia-node
ADD package.json /srv/olympia-node/package.json
WORKDIR /srv/olympia-node
RUN npm install
COPY . /code
WORKDIR /code
@ -51,9 +71,11 @@ WORKDIR /code
# This works best when you link your local source code
# as a volume.
ENV HISTFILE /code/docker/artifacts/bash_history
# Configure bash history.
ENV HISTSIZE 50000
ENV HISTIGNORE ls:exit:"cd .."
# This prevents dupes but only in memory for the current session.
ENV HISTCONTROL erasedups

Просмотреть файл

@ -74,7 +74,7 @@ update_code:
git checkout master && git pull
update_deps:
pip install --no-deps --exists-action=w -r requirements/dev.txt --find-links https://pyrepo.stage.mozaws.net/wheelhouse/ --find-links https://pyrepo.stage.mozaws.net/ --no-index
pip install --no-deps --exists-action=w -r requirements/dev.txt --find-links https://pyrepo.stage.mozaws.net/olympia/ --find-links https://pyrepo.stage.mozaws.net/ --no-index
update_db:
schematic migrations

Просмотреть файл

@ -1,5 +0,0 @@
[mysql-community-releases]
name=Mysql Community Packages
baseurl=http://repo.mysql.com/yum/mysql-community/el/6/$basearch/
gpgcheck=0
enabled=1

Просмотреть файл

@ -0,0 +1,97 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (SunOS)
mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3
RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ
fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0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muQT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkK
Ht926s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUO
etdZWhe70YGNPw1yjWJT1IhUBBgRAgAMBQJOdz3tBQkT+wG4ABIHZUdQRwABAQkQ
jHGNO1By4fUUmwCbBYr2+bBEn/L2BOcnw9Z/QFWuhRMAoKVgCFm5fadQ3Afi+UQl
AcOphrnJ
=443I
-----END PGP PUBLIC KEY BLOCK-----

6
docker/mysql.repo Normal file
Просмотреть файл

@ -0,0 +1,6 @@
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=https://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

29
docker/nodesource.gpg.key Normal file
Просмотреть файл

@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFQCN9QBEADv5QYOlCWNkI/oKST/GGpQkOZjFY2cbYdHuc2j8kyM4oeNluXq
puEYMHOoQvbJ3DFPvsv+jCruL7qjkel9YzaF6e3RN2ystP4YBjxyOT7Bb5EnjNNU
6oScQJ50/+RmA4N3wzBrw5+x5KQGBfRU/k7JdDKO6SGY0zzdAo3jqp1nQ9Sf+Fmg
hsjDLVZTHorLPV3yPLb37QlvBB2YIRF+dL9l4wPAI/fGyWv+Qs7VlCZTyRAnKGbv
qN1LvlYoV9YqxaJYYJW+MQhn4706yNJAFeOZuKejEcnZTd/NBiAR91sVnsXKgW9e
yb4TZ7SqkmrJpuKJBpdPr1dgaK8dDmFh9Nlhpz6xZuYcKaDEDa5b3wymnixtwZf2
WyboChIlsHDajtXZt34xP9uUge1VHyk1o8AQUzKEpuepxxLnyXArLgvHaLhQnxPA
bQB43b4RbWYHPdB16ki2WoZX/DA4YEtfxg8GC3zXC2thMJnFburmts71iiYsxKBc
6d7O8415xrErhk2/o2+bRhf+7qBQfW0oxQSEMBYbqP3hvhG1VWc9umjbCfMgHrHo
IzI7W+GbRdbSsdpY6JNKuCftVfIKXeXk5FbUUP9NzsG/nyGFORkq9y0AKmocx3TD
w9DRG2SmKIKBOG5PQuzuXqsdUaYcFpySXdPNQG2CPtguPhQivw4qM3pQpQARAQAB
tCNOb2RlU291cmNlIDxncGctcnBtQG5vZGVzb3VyY2UuY29tPokCOAQTAQIAIgUC
VAI31AIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQXdvo1DT6dN2uaA//
UwKsmnz4MCH7Jn/vG0OinGQTfSH5uvlH68yOZmKLnhtfiqUq1gZz734S75ExxGP4
SGFYeK9CqKFgoGbpjzLLc5kvA7GdDX3E/exEjYa+GrJ9uIOUtaCKstTD5fPVj2Wf
TZtK9v1F6iYKyPHdJnSc5p7AxbLZkarF1CPJQWv2iDrg3dO3Oy41aazRwxJe9hvI
a//XavnsW2TTeo8qfQ0qrs8vzt8bxJF+PkACmqQfbXAiflCct5XEUbhbX1b8KznP
ppd5PLrvRTjHnZi/QRjky0qsUOukGiQhT6iZeiOUcLPeD+f7tA7JBZ08XXRfnLLj
mqYbIHPFG4C/AM5RXu5OdCtFrZQsJgGQEeg/UxYEz5qqNljKjRZ8XsmcyeWouKFM
LuVr1ORF6crl8lAdT3RujP2MzY8cvxJQesYKdWqk3bPXI7oG/PRReoeN86TqraYO
UeTssVlw5lmJtAH+eHt3K6TSjd0rq1RY7xWfttD7L8ECfPmBzbL54MSmKx9MBz+o
a9vOWQ2LjIbR/6DEyQiDpGhQTM+r0/SVS/kqR/j0SEHvOql+sn9sK1/qR1h3JtgI
6YF4IDXBE9s0RBCLbdxtVf3eAcbOnhkhefMtpURJLdVuU8HhMCiVUlHDUPHIuT5z
Lp+avdanIgi8Cnps/DpMI2KigEHW5mmqihXtfKj0jeE=
=9Bql
-----END PGP PUBLIC KEY BLOCK-----

7
docker/nodesource.repo Normal file
Просмотреть файл

@ -0,0 +1,7 @@
[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://s3-us-west-2.amazonaws.com/net-mozaws-prod-us-west-2-ops-rpmrepo-mirror/nodesource/0.12/7/x86_64/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nodesource

Просмотреть файл

@ -1,5 +1,7 @@
--no-index
# This is probably nuts, let's work towards only using /olympia/ in the future
--find-links https://pyrepo.stage.mozaws.net/olympia/
--find-links https://pyrepo.stage.mozaws.net/
--find-links https://pyrepo.stage.mozaws.net/wheelhouse/
--find-links https://pyrepo.stage.mozaws.net/wheelhouse
-r dev.txt