From 83d588b829f7b1ef95c0cf3ed23fc44428aafe63 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Tue, 18 Jul 2017 22:17:04 -0500 Subject: [PATCH] Initial Dockerfile cleanup This PS removes some unused files from the repo, and fixes the port definition in the dockerfile. --- Dockerfile | 2 +- Dockerfile.inter | 27 --------------------------- README.md | 8 ++++---- entrypoint.sh | 3 +-- requirements.txt | 10 ---------- 5 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 Dockerfile.inter delete mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index c352d748..5579dadf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ COPY . /tmp/drydock WORKDIR /tmp/drydock RUN python3 setup.py install -EXPOSE 9000 +EXPOSE 8000 ENTRYPOINT ["./entrypoint.sh"] diff --git a/Dockerfile.inter b/Dockerfile.inter deleted file mode 100644 index 3f1e0dc3..00000000 --- a/Dockerfile.inter +++ /dev/null @@ -1,27 +0,0 @@ -# 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 - -RUN apt -qq update && \ - apt -y install git netbase python3-minimal python3-setuptools python3-pip python3-dev ca-certificates gcc g++ make libffi-dev libssl-dev --no-install-recommends - -# Need to configure proxies? -ADD requirements.txt /tmp/drydock/requirements.txt - -WORKDIR /tmp/drydock - -RUN pip3 install -r requirements.txt diff --git a/README.md b/README.md index f968056a..bce9623f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # drydock_provisioner A python REST orchestrator to translate a YAML host topology to a provisioned set of hosts and provide a set of cloud-init post-provisioning instructions. -To run: +To build and run, first move into the root directory of the repo and run: - $ docker build . -t drydock - $ docker run -v /path/to/drydock/repo/examples:/etc/drydock -P --name='drydock' drydock - $ DDPORT=$(docker ps -f name=drydock | grep -oE '0.0.0.0:[0-9]+' | cut -d':' -f 2) + $ sudo docker build . -t drydock + $ sudo docker run -d -v $(pwd)/examples:/etc/drydock -P --name='drydock' drydock + $ DDPORT=$(sudo docker port drydock 8000/tcp | awk -F ':' '{ print $NF }') $ curl -v http://localhost:${DDPORT}/api/v1.0/designs ## Modular service diff --git a/entrypoint.sh b/entrypoint.sh index c9933790..d6ceca38 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,10 +1,9 @@ #!/bin/bash +set -ex CMD="drydock" PORT="8000" -set -e - if [ "$1" = 'server' ]; then exec uwsgi --http :${PORT} -w drydock_provisioner.drydock --callable drydock --enable-threads -L --pyargv "--config-file /etc/drydock/drydock.conf" fi diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index dbd23942..00000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -PyYAML -pyghmi>=1.0.18 -netaddr -falcon -oslo.versionedobjects>=1.23.0 -requests -oauthlib -uwsgi>1.4 -bson===0.4.7 -oslo.config===4.6.0 \ No newline at end of file