Closed 130s closed 6 years ago
(Not an official reference but) according to https://github.com/tianon/docker-brew-ubuntu-core/issues/48 sudo
doesn't come with the "minimal set of packages".
Is this something we want to resolve in this repo or downstream?
Absense of sudo
might not matter on online CI services where each job runs as root, so this might be an issue when one wants to run docker build
on a local computer.
Still, I want to know where's the best place to implement a workaround to this.
sudo
in a Docker image seems a bit strange to me: unless a different user has been explicitly added to the container, you'll be root
.
I don't see a new user added to the images in this repository. @130s: what do you require sudo
for?
I agree with @gavanderhoorn (I am sure that I have written a comment 2 weeks ago, but somehow it did not make it here)
so this might be an issue when one wants to run docker build on a local computer.
By default docker build
runs all command as root, but without any mounts, so what's the issue here?
(The user can be overwritten by the USER directive only)
I might be doing something wrong, but with the following simple Dockerfile
,
FROM rosindustrial/ci:kinetic-xenial
RUN sudo rosdep init; rosdep update
$ docker build -f ./Dockerfile -t foo_image .
:
Step 2/2 : RUN sudo rosdep init; rosdep update
---> Running in d38e9949c654
/bin/sh: 1: sudo: not found
ERROR: no sources directory exists on the system meaning rosdep has not yet been initialized.
Please initialize your rosdep with
sudo rosdep init
The command '/bin/sh -c sudo rosdep init; rosdep update' returned a non-zero code: 1
apt-get install sudo
works this around.
RUN sudo rosdep init; rosdep update
I might be misunderstanding you, but you don't need sudo
there.
Everything in the Docker build sequence is run as root
, unless you explicitly change it to not do that.
Ok, so, in Dockerfile
I don't need sudo
(regardless the platform the file is intended for). Thanks for the inputs @gavanderhoorn @ipa-mdl
Not even sure if this is a problem or not but I see
sudo
is available in Trusty image but not in Xenial: