|
| 1 | +# Copyright 2017 AT&T Intellectual Property. All other rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +FROM ubuntu:16.04 |
| 16 | + |
| 17 | +ENV DEBIAN_FRONTEND noninteractive |
| 18 | +ENV container docker |
| 19 | + |
| 20 | +# Shipyard |
| 21 | +ARG SHIPYARD_HOME=/home/shipyard |
| 22 | + |
| 23 | +RUN apt-get -qq update && \ |
| 24 | + apt-get -y install \ |
| 25 | + git \ |
| 26 | + curl \ |
| 27 | + netcat \ |
| 28 | + netbase \ |
| 29 | + python \ |
| 30 | + python-setuptools \ |
| 31 | + python-pip \ |
| 32 | + python-dev \ |
| 33 | + ca-certificates \ |
| 34 | + gcc \ |
| 35 | + g++ \ |
| 36 | + make \ |
| 37 | + libffi-dev \ |
| 38 | + libssl-dev \ |
| 39 | + --no-install-recommends \ |
| 40 | + && pip install --upgrade pip \ |
| 41 | + && pip install falcon \ |
| 42 | + && pip install requests \ |
| 43 | + && pip install uwsgi \ |
| 44 | + && pip install configparser \ |
| 45 | + && pip install python-openstackclient==3.11.0 \ |
| 46 | + && apt-get clean \ |
| 47 | + && rm -rf \ |
| 48 | + /var/lib/apt/lists/* \ |
| 49 | + /tmp/* \ |
| 50 | + /var/tmp/* \ |
| 51 | + /usr/share/man \ |
| 52 | + /usr/share/doc \ |
| 53 | + /usr/share/doc-base |
| 54 | + |
| 55 | +# Create shipyard user |
| 56 | +RUN useradd -ms /bin/bash shipyard |
| 57 | + |
| 58 | +# Clone the shipyard repository |
| 59 | +RUN git clone https://github.com/att-comdev/shipyard.git ${SHIPYARD_HOME}/shipyard |
| 60 | + |
| 61 | +# Copy entrypoint.sh to /home/shipyard |
| 62 | +COPY entrypoint.sh ${SHIPYARD_HOME}/entrypoint.sh |
| 63 | + |
| 64 | +# Copy shipyard.conf to /home/shipyard |
| 65 | +COPY shipyard.conf ${SHIPYARD_HOME}/shipyard.conf |
| 66 | + |
| 67 | +# Change permissions |
| 68 | +RUN chown -R shipyard: ${SHIPYARD_HOME} \ |
| 69 | + && chmod +x ${SHIPYARD_HOME}/entrypoint.sh |
| 70 | + |
| 71 | +# Expose port 9000 for application |
| 72 | +EXPOSE 9000 |
| 73 | + |
| 74 | +# Set work directory |
| 75 | +USER shipyard |
| 76 | +WORKDIR ${SHIPYARD_HOME}/shipyard |
| 77 | + |
| 78 | +# Execute entrypoint |
| 79 | +ENTRYPOINT ["/home/shipyard/entrypoint.sh"] |
| 80 | + |
0 commit comments