243022d16c
Readthedocs failed to render Armada exceptions with error: > WARNING: autodoc: failed to import exception ... from module > 'armada'; the following exception was raised: No module named 'armada' and others. Trying to add Armada requirements to the installed requirements list, so that Readthedocs has all modules, including those needed for the Armada itself. Cosmetic readability changes: 1. combined all Makefile .PHONY targets into one 2. merged multiple LABEL instructions in Dockerfile into one Change-Id: I3f88fa3abf66e5d6a2f9e57f6f1514a03a0c5a30
81 lines
1.9 KiB
Docker
81 lines
1.9 KiB
Docker
ARG FROM=ubuntu:16.04
|
|
FROM ${FROM}
|
|
|
|
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
|
|
org.opencontainers.image.url='https://airshipit.org' \
|
|
org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' \
|
|
org.opencontainers.image.source='https://opendev.org/airship/armada' \
|
|
org.opencontainers.image.vendor='The Airship Authors' \
|
|
org.opencontainers.image.licenses='Apache-2.0'
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
ENV LANG=C.UTF-8
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
EXPOSE 8000
|
|
|
|
RUN set -ex && \
|
|
apt-get -qq update && \
|
|
apt-get -y install \
|
|
ca-certificates \
|
|
curl \
|
|
netbase \
|
|
python3-dev \
|
|
python3-setuptools \
|
|
--no-install-recommends \
|
|
&& apt-get autoremove -yqq --purge \
|
|
&& apt-get clean \
|
|
&& rm -rf \
|
|
/var/lib/apt/lists/* \
|
|
/tmp/* \
|
|
/var/tmp/* \
|
|
/usr/share/man \
|
|
/usr/share/doc \
|
|
/usr/share/doc-base
|
|
|
|
WORKDIR /armada
|
|
|
|
# Add armada user
|
|
RUN useradd -u 1000 -g users -d $(pwd) armada
|
|
|
|
ENTRYPOINT ["./entrypoint.sh"]
|
|
CMD ["server"]
|
|
|
|
COPY requirements.txt ./
|
|
|
|
# Build
|
|
RUN set -ex \
|
|
&& buildDeps=' \
|
|
gcc \
|
|
libssl-dev \
|
|
make \
|
|
python3-pip \
|
|
' \
|
|
&& apt-get -qq update \
|
|
# Keep git separate so it's not removed below
|
|
&& apt-get install -y $buildDeps git --no-install-recommends \
|
|
&& python3 -m pip install -U pip \
|
|
&& pip3 install -r requirements.txt --no-cache-dir \
|
|
&& apt-get purge -y --auto-remove $buildDeps \
|
|
&& apt-get autoremove -yqq --purge \
|
|
&& apt-get clean \
|
|
&& rm -rf \
|
|
/var/lib/apt/lists/* \
|
|
/tmp/* \
|
|
/var/tmp/* \
|
|
/usr/share/man \
|
|
/usr/share/doc \
|
|
/usr/share/doc-base
|
|
|
|
COPY . ./
|
|
|
|
# Setting the version explicitly for PBR
|
|
ENV PBR_VERSION 0.8.0
|
|
|
|
RUN \
|
|
mv etc/armada /etc/ && \
|
|
chown -R armada:users . && \
|
|
python3 setup.py install
|
|
|
|
USER armada
|