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:
parent
37dae6df9f
commit
218beff695
4
Makefile
4
Makefile
|
@ -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");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with 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.
|
# Make targets intended for use by the primary targets above.
|
||||||
.PHONY: build_deckhand
|
.PHONY: build_deckhand
|
||||||
build_deckhand:
|
build_deckhand:
|
||||||
docker build -t $(IMAGE) --label $(LABEL) .
|
docker build -t $(IMAGE) --label $(LABEL) -f images/deckhand/Dockerfile .
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -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");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with 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 DEBIAN_FRONTEND noninteractive
|
||||||
ENV container docker
|
ENV container docker
|
||||||
|
ENV PORT 9000
|
||||||
|
|
||||||
|
# Expose port 9000 for application
|
||||||
|
EXPOSE $PORT
|
||||||
|
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
apt-get -qq update && \
|
apt-get -qq update && \
|
||||||
|
@ -47,26 +51,23 @@ RUN set -x && \
|
||||||
/usr/share/doc \
|
/usr/share/doc \
|
||||||
/usr/share/doc-base
|
/usr/share/doc-base
|
||||||
|
|
||||||
# Copy dependency requirements
|
|
||||||
COPY ./requirements.txt /tmp/
|
|
||||||
RUN pip3 install -r /tmp/requirements.txt
|
|
||||||
|
|
||||||
# Create deckhand user
|
# Create deckhand user
|
||||||
RUN useradd -ms /bin/bash deckhand
|
RUN useradd -ms /bin/bash deckhand
|
||||||
|
|
||||||
# Clone the deckhand repository
|
# Clone the deckhand repository
|
||||||
COPY ./ /home/deckhand/
|
COPY . /home/deckhand/
|
||||||
|
|
||||||
# Change permissions
|
# Change permissions
|
||||||
RUN chown -R deckhand: /home/deckhand \
|
RUN chown -R deckhand: /home/deckhand \
|
||||||
&& chmod +x /home/deckhand/entrypoint.sh
|
&& chmod +x /home/deckhand/entrypoint.sh
|
||||||
|
|
||||||
# Expose port 9000 for application
|
# Set work directory and install dependencies
|
||||||
EXPOSE 9000
|
WORKDIR /home/deckhand
|
||||||
|
RUN pip3 install -r requirements.txt
|
||||||
|
RUN python3 setup.py install
|
||||||
|
|
||||||
# Set work directory
|
# Set user to deckhand
|
||||||
USER deckhand
|
USER deckhand
|
||||||
WORKDIR /home/deckhand/
|
|
||||||
|
|
||||||
# Execute entrypoint
|
# Execute entrypoint
|
||||||
ENTRYPOINT ["/home/deckhand/entrypoint.sh"]
|
ENTRYPOINT ["/home/deckhand/entrypoint.sh"]
|
Loading…
Reference in New Issue