I have created this docker file to run a python script in docker container. I am creating a user here and I want this user to run the container from docker image.
FROM ubuntu:16.04
MAINTAINER "Vijendra Kulhade" <xxxxxx@xxxxxx.com>
RUN yum makecache fast
RUN yum -y update
RUN yum -y install gcc
RUN yum -y install zlib-devel
RUN yum -y install openssl-devel
RUN yum -y install python-setuptools python-setuptools-devel
RUN yum -y install libyaml
RUN useradd newuser -d /home/newuser
RUN chown -R newuser.newuser /usr/bin/
RUN chown -R newuser.newuser /usr/lib64/
RUN chown -R newuser.newuser /usr/lib/
ENV https_proxy=http://proxy.xxxx.com:8080
RUN easy_install pip
RUN pip -V
RUN pip install --upgrade pip
RUN pip install --upgrade --force-reinstall setuptools
I use this command to create the image
docker build -t python-container .
And I am using
docker run --security-opt label=user:newuser -i -t python-container:latest /bin/bash to run container from image. I was expecting that this would start the container and login into it with newuser@xxxxxxxx. But It is not happening.
Please let know how I can achieve that.
docker logsto see what happen?yum, it usesaptfor package managing. How did you build that image?