From 9bdc5ff05a383669c681f1856f193351acb89fda Mon Sep 17 00:00:00 2001 From: Julio Ruano Date: Fri, 17 Jan 2020 10:45:37 -0600 Subject: [PATCH] Fix Dockerfile-tools for local build --- Dockerfile-tools | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Dockerfile-tools b/Dockerfile-tools index 742e3df..de28765 100755 --- a/Dockerfile-tools +++ b/Dockerfile-tools @@ -1,13 +1,22 @@ -FROM python:3.6-alpine +# Use base UBI image +FROM registry.access.redhat.com/ubi8/ubi WORKDIR /app COPY requirements.txt /tmp/requirements.txt -RUN apk --update add python py-pip openssl ca-certificates py-openssl wget bash linux-headers -RUN apk --update add --virtual build-dependencies libffi-dev openssl-dev python-dev py-pip build-base \ - && pip install --upgrade pip \ - && pip install --upgrade -r /tmp/requirements.txt \ - && apk del build-dependencies + +# Install python3 +RUN yum -y install --disableplugin=subscription-manager python36 \ + && yum --disableplugin=subscription-manager clean all + +RUN yum -y install --disableplugin=subscription-manager python3-pip wget \ + && yum --disableplugin=subscription-manager clean all + +RUN pip3 install --upgrade -r /tmp/requirements.txt + +# Update python command to point to python3 install +RUN alternatives --set python /usr/bin/python3 + ENV FLASK_APP=server/__init__.py ENV FLASK_DEBUG=true @@ -15,10 +24,9 @@ COPY . /app COPY run-dev /bin RUN chmod 777 /bin/run-dev - ARG bx_dev_user=root ARG bx_dev_userid=1000 RUN BX_DEV_USER=$bx_dev_user RUN BX_DEV_USERID=$bx_dev_userid -RUN if [ "$bx_dev_user" != root ]; then adduser -D -s /bin/bash -u $bx_dev_userid $bx_dev_user; fi +RUN if [ "$bx_dev_user" != root ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi