Skip to content

Can not use conda command as non root user. #151

@cpaulik

Description

@cpaulik

Running conda as another user than root does not seem to work anymore with the latest images.
This used to work fine with older images

The dockerfile:

FROM continuumio/miniconda:latest
RUN apt-get update && \
    apt-get -y install sudo curl
RUN groupadd -g 1002 ubuntu && \
    useradd -r -m -u 1001 -g ubuntu -G sudo ubuntu
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER ubuntu
RUN mkdir /home/ubuntu/code
WORKDIR /home/ubuntu/code
RUN conda install pip

give the following error when running docker build -f Dockerfile .

Step 1/8 : FROM continuumio/miniconda:latest
 ---> f3ca74752199
Step 2/8 : RUN apt-get update &&     apt-get -y install sudo curl
 ---> Using cache
 ---> 64d5f3d00441
Step 3/8 : RUN groupadd -g 1002 ubuntu &&     useradd -r -m -u 1001 -g ubuntu -G sudo ubuntu
 ---> Using cache
 ---> 6ef6acdf3bd2
Step 4/8 : RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
 ---> Using cache
 ---> cd7e2bc0a95e
Step 5/8 : USER ubuntu
 ---> Using cache
 ---> 331927bb4936
Step 6/8 : RUN mkdir /home/ubuntu/code
 ---> Using cache
 ---> f242c23d26dd
Step 7/8 : WORKDIR /home/ubuntu/code
 ---> Using cache
 ---> 7813f2656416
Step 8/8 : RUN conda install pip
 ---> Running in 9a8d14e3ef09
Collecting package metadata (current_repodata.json): ...working... failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /opt/conda/pkgs/urls.txt
  uid: 1001
  gid: 1002

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1001:1002 /opt/conda/pkgs/urls.txt

In general, it's not advisable to use 'sudo conda'.


The command '/bin/sh -c conda install pip' returned a non-zero code: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions