Update Deckhand Dockerfile

This patch set does the following:

1) Moves Dockerfile to images/deckhand to align with the
   convention used by the rest of the UCP components

2) Installs Deckhand module

Change-Id: I48e5a061538367678314fef213cfb38de53e90bd
This commit is contained in:
Anthony Lin 2018-02-26 05:09:30 +00:00 committed by Mark Burnett
parent 37dae6df9f
commit 218beff695
2 changed files with 13 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.
# Copyright 2018 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.
@ -43,7 +43,7 @@ dry-run: clean
# Make targets intended for use by the primary targets above.
.PHONY: build_deckhand
build_deckhand:
docker build -t $(IMAGE) --label $(LABEL) .
docker build -t $(IMAGE) --label $(LABEL) -f images/deckhand/Dockerfile .
.PHONY: clean
clean:

View File

@ -1,4 +1,4 @@
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.
# Copyright 2018 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.
@ -16,6 +16,10 @@ FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
ENV container docker
ENV PORT 9000
# Expose port 9000 for application
EXPOSE $PORT
RUN set -x && \
apt-get -qq update && \
@ -47,26 +51,23 @@ RUN set -x && \
/usr/share/doc \
/usr/share/doc-base
# Copy dependency requirements
COPY ./requirements.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt
# Create deckhand user
RUN useradd -ms /bin/bash deckhand
# Clone the deckhand repository
COPY ./ /home/deckhand/
COPY . /home/deckhand/
# Change permissions
RUN chown -R deckhand: /home/deckhand \
&& chmod +x /home/deckhand/entrypoint.sh
# Expose port 9000 for application
EXPOSE 9000
# Set work directory and install dependencies
WORKDIR /home/deckhand
RUN pip3 install -r requirements.txt
RUN python3 setup.py install
# Set work directory
# Set user to deckhand
USER deckhand
WORKDIR /home/deckhand/
# Execute entrypoint
ENTRYPOINT ["/home/deckhand/entrypoint.sh"]