From 00009e961c81a872da51a498015c1fb0d568a856 Mon Sep 17 00:00:00 2001 From: eanylin Date: Thu, 15 Jun 2017 20:03:37 -0500 Subject: [PATCH] Dockerfile for Shipyard Update Shipyard Dockerfiles --- shipyard/Dockerfile | 80 ++++++++++++++++++++++++++++++++++++++++++ shipyard/README.md | 4 +++ shipyard/entrypoint.sh | 20 +++++++++++ shipyard/shipyard.conf | 3 ++ 4 files changed, 107 insertions(+) create mode 100644 shipyard/Dockerfile create mode 100644 shipyard/README.md create mode 100644 shipyard/entrypoint.sh create mode 100644 shipyard/shipyard.conf diff --git a/shipyard/Dockerfile b/shipyard/Dockerfile new file mode 100644 index 0000000..c7c38d9 --- /dev/null +++ b/shipyard/Dockerfile @@ -0,0 +1,80 @@ +# Copyright 2017 AT&T Intellectual Property. All other rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:16.04 + +ENV DEBIAN_FRONTEND noninteractive +ENV container docker + +# Shipyard +ARG SHIPYARD_HOME=/home/shipyard + +RUN apt-get -qq update && \ + apt-get -y install \ + git \ + curl \ + netcat \ + netbase \ + python \ + python-setuptools \ + python-pip \ + python-dev \ + ca-certificates \ + gcc \ + g++ \ + make \ + libffi-dev \ + libssl-dev \ + --no-install-recommends \ + && pip install --upgrade pip \ + && pip install falcon \ + && pip install requests \ + && pip install uwsgi \ + && pip install configparser \ + && pip install python-openstackclient==3.11.0 \ + && apt-get clean \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* \ + /usr/share/man \ + /usr/share/doc \ + /usr/share/doc-base + +# Create shipyard user +RUN useradd -ms /bin/bash shipyard + +# Clone the shipyard repository +RUN git clone https://github.com/att-comdev/shipyard.git ${SHIPYARD_HOME}/shipyard + +# Copy entrypoint.sh to /home/shipyard +COPY entrypoint.sh ${SHIPYARD_HOME}/entrypoint.sh + +# Copy shipyard.conf to /home/shipyard +COPY shipyard.conf ${SHIPYARD_HOME}/shipyard.conf + +# Change permissions +RUN chown -R shipyard: ${SHIPYARD_HOME} \ + && chmod +x ${SHIPYARD_HOME}/entrypoint.sh + +# Expose port 9000 for application +EXPOSE 9000 + +# Set work directory +USER shipyard +WORKDIR ${SHIPYARD_HOME}/shipyard + +# Execute entrypoint +ENTRYPOINT ["/home/shipyard/entrypoint.sh"] + diff --git a/shipyard/README.md b/shipyard/README.md new file mode 100644 index 0000000..479df61 --- /dev/null +++ b/shipyard/README.md @@ -0,0 +1,4 @@ +## Shipyard ## + +Shipyard dockerfiles + diff --git a/shipyard/entrypoint.sh b/shipyard/entrypoint.sh new file mode 100644 index 0000000..fe0c468 --- /dev/null +++ b/shipyard/entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Copyright 2017 AT&T Intellectual Property. All other rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# Start shipyard application +/usr/local/bin/uwsgi --http :9000 -w shipyard_airflow.shipyard --callable shipyard --enable-threads -L + diff --git a/shipyard/shipyard.conf b/shipyard/shipyard.conf new file mode 100644 index 0000000..6dadc48 --- /dev/null +++ b/shipyard/shipyard.conf @@ -0,0 +1,3 @@ +[BASE] +WEB_SERVER=http://localhost:32080 +