Comments (5)
Since you have not posted the error message, the image you're using, or any other information, I'm not sure what your exact problem is. However, you do need to run sudo apt-get update
before installing things. Did you do this?
from docker-pytorch.
I am having a similar error. After running sudo apt-get update
, I get the following error:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
.
Is there some kind of step I should be doing before this? Might this be related to adding and switching to the non-root user? I am running docker container in singularity after converting it to a singularity image.
from docker-pytorch.
@alexfarhang It could be a problem with whatever singularity is doing (I don't know what it is and certainly haven't tested with it). I can install software in a running container just fine:
aiden@aiden-ubuntu:~$ docker run --rm -it anibali/pytorch:1.8.1-cuda11.1-ubuntu20.04 bash
user@41031d5b9b38:/app$ sudo apt-get update
Ign:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
[...]
Fetched 17.9 MB in 7s (2598 kB/s)
Reading package lists... Done
user@41031d5b9b38:/app$ sudo apt-get install cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libtext-charwidth-perl
Suggested packages:
filters cowsay-off
The following NEW packages will be installed:
cowsay libtext-charwidth-perl
0 upgraded, 2 newly installed, 0 to remove and 11 not upgraded.
Need to get 28.4 kB of archives.
After this operation, 135 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libtext-charwidth-perl amd64 0.04-10 [9872 B]
Get:2 http://archive.ubuntu.com/ubuntu focal/universe amd64 cowsay all 3.03+dfsg2-7 [18.5 kB]
Fetched 28.4 kB in 1s (30.8 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libtext-charwidth-perl.
(Reading database ... 8251 files and directories currently installed.)
Preparing to unpack .../libtext-charwidth-perl_0.04-10_amd64.deb ...
Unpacking libtext-charwidth-perl (0.04-10) ...
Selecting previously unselected package cowsay.
Preparing to unpack .../cowsay_3.03+dfsg2-7_all.deb ...
Unpacking cowsay (3.03+dfsg2-7) ...
Setting up libtext-charwidth-perl (0.04-10) ...
Setting up cowsay (3.03+dfsg2-7) ...
user@41031d5b9b38:/app$ /usr/games/cowsay 'Installing software works'
___________________________
< Installing software works >
---------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
user@41031d5b9b38:/app$
from docker-pytorch.
Thanks for the quick response. Yes, I think that's the case. What is the purpose of the of this block in the docker file:
# Create a non-root user and switch to it RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ && chown -R user:user /app RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user USER user
from docker-pytorch.
It sets the image up so that when you run a container you will not be root inside the container, providing a small amount of safety. For example, if you don't do this and then you mount a volume on the host you will be able to create/modify/delete files owned by root on the host from inside the container.
from docker-pytorch.
Related Issues (20)
- this is the issue which it's showing while running the docker file HOT 2
- Cuda not found after pulling docker image at docker pull anibali/pytorch:1.4.0-cuda10.1 HOT 2
- can we have a docker image with torch 1.4+ cuda 10.2 and ubuntu 16.04 HOT 1
- Any ideas regarding reducing Image size? HOT 1
- pytorch 1.3 with cuda 10 on ubuntu 18.04 image HOT 1
- Is CUDA being downloaded twice? HOT 4
- python3: can't open file 'script.py': [Errno 2] No such file or directory HOT 4
- CUDA Version Problem HOT 1
- Disable user prompt when building dockerfile HOT 1
- install HOT 1
- docker image failed to build HOT 2
- why do we use miniconda with pytorch cuda image? HOT 2
- Images to work with for Google Cloud SDK HOT 1
- About the permissions of docekr images HOT 1
- Key errors when deriving from 2.0 images & installing packages HOT 2
- How to enter the container with su mode HOT 1
- Size to big: use multi stage docker files HOT 4
- ERROR: failed to solve -> 1.7.0-cuda11.0-ubuntu20.04 HOT 1
- Support arm64 platform image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-pytorch.