aboutsummaryrefslogtreecommitdiffstats
path: root/standalone/src/main/assembly/dockerfile
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-11-04 09:21:03 +0100
committerzhao yehua <zhaoyh6@asiainfo.com>2021-11-04 13:17:45 +0000
commit302423c69fb45b242c2c41679e92491653a96611 (patch)
treeb14f6fdfd39eed6281647523f907cddb78164f5b /standalone/src/main/assembly/dockerfile
parent8125d5d5cb024135b154b2539826ad11905fb1f6 (diff)
Better Dockerfile
Instead of running several RUN and retrieve archive at run, use best practices in order to have a cleaner (but not at the best) Dockerfile. Issue-ID: USECASEUI-605 Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com> Change-Id: I7d55e8fc2fd4ba743e02f63960e389c081e705e9
Diffstat (limited to 'standalone/src/main/assembly/dockerfile')
-rw-r--r--standalone/src/main/assembly/dockerfile50
1 files changed, 32 insertions, 18 deletions
diff --git a/standalone/src/main/assembly/dockerfile b/standalone/src/main/assembly/dockerfile
index 4203e20..4a8bbc3 100644
--- a/standalone/src/main/assembly/dockerfile
+++ b/standalone/src/main/assembly/dockerfile
@@ -1,27 +1,41 @@
+# hadolint ignore=DL3007
FROM tensorflow/serving:latest
-RUN mkdir -p /home/uuihome/uui
-
WORKDIR /home/uuihome/uui
-RUN groupadd uui -g 1000
-
-RUN useradd -u 1000 -d /home/uuihome/uui -g uui -s /bin/bash uui
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get update
-RUN DEBIAN_FRONTEND=noninteractive apt-get install wget -y
-RUN DEBIAN_FRONTEND=noninteractive apt-get install unzip -y
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install python3-pip python3-dev build-essential -y
-RUN ln -s /usr/bin/python3 /usr/bin/python
-RUN ln -s /usr/bin/pip3 /usr/bin/pip
-
-COPY requirements /home/uuihome/uui/requirements
-RUN DEBIAN_FRONTEND=noninteractive pip install -r requirements
-COPY scripts /home/uuihome/uui/scripts
+COPY requirements.txt /home/uuihome/uui/requirements.txt
+
+# hadolint ignore=DL3008
+RUN groupadd uui -g 1000 && \
+ useradd -u 1000 -d /home/uuihome/uui -g uui -s /bin/bash uui && \
+ DEBIAN_FRONTEND=noninteractive apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
+ build-essential \
+ curl \
+ python3-dev \
+ python3-pip \
+ unzip && \
+ curl -LO https://github.com/google-research/bert/archive/master.zip && \
+ curl -LO https://storage.googleapis.com/bert_models/2018_10_18/uncased_L-12_H-768_A-12.zip && \
+ unzip master.zip && \
+ unzip uncased_L-12_H-768_A-12.zip && \
+ rm master.zip uncased_L-12_H-768_A-12.zip && \
+ ln -s /usr/bin/python3 /usr/bin/python && \
+ ln -s /usr/bin/pip3 /usr/bin/pip && \
+ pip install --no-cache-dir -r requirements.txt && \
+ DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y \
+ build-essential \
+ curl \
+ python3-dev \
+ unzip && \
+ DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+COPY scripts /home/uuihome/uui/bert-master/
COPY run.sh /home/uuihome/uui/run.sh
RUN chown -R uui:uui /home/uuihome/uui
USER uui
-ENTRYPOINT /home/uuihome/uui/run.sh \ No newline at end of file
+ENTRYPOINT ["/home/uuihome/uui/run.sh"]