ranger/images/rangercli/Dockerfile
jh629g f7283a3588 Fixed error in Dockerfile
Dockerfile features variable which
overrides the correct base image
value being passed to Dockerfile,
if the correct value is different
than the default value.

Change-Id: Icd9c1f358f29d99521491b9e0e2885c235fac158
2020-01-22 10:39:25 -06:00

65 lines
1.2 KiB
Docker

ARG BASE_IMAGE
FROM ${BASE_IMAGE}
#ubuntu environment variables
ENV DEBIAN_FRONTEND noninteractive
ENV container docker
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# define and pass application environment variables
ARG ranger_user
ENV RANGER_USERNAME ${ranger_user:-ranger}
# install needed components
RUN apt -qq update && \
apt -y install git \
netcat \
netbase \
openssh-server \
python3-minimal \
python3-setuptools \
python3-pip \
python3-dev \
python3-dateutil \
ca-certificates \
openstack-pkg-tools \
vim \
curl \
gcc \
g++ \
libffi-dev \
libssl-dev --no-install-recommends \
libmysqlclient-dev \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
RUN pip3 install wheel
COPY . /tmp/ranger
WORKDIR /tmp/ranger
RUN pip3 install --default-timeout=100 -r requirements.txt
RUN python3 setup.py install
WORKDIR /tmp
# Create user
RUN useradd -u 1000 -ms /bin/bash ${RANGER_USERNAME}
# Change permissions
RUN mv /tmp/ranger/orm/orm_client /home/${RANGER_USERNAME}/ \
&& rm -rf /tmp/* \
&& chown -R ${RANGER_USERNAME}: /home/${RANGER_USERNAME}/orm_client
# Set work directory
USER ${RANGER_USERNAME}
WORKDIR /home/${RANGER_USERNAME}/orm_client/ormcli