I have installed TensorFlow using the following command
docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel
and I need to set up TensorFlow Serving on a windows machine. I followed the instructions and while running the below-mentioned sudo
command while installing TensorFlow Serving dependencies:
sudo apt-get update && sudo apt-get install -y \
build-essential \
curl \
git \
libfreetype6-dev \
libpng12-dev \
libzmq3-dev \
pkg-config \
python-dev \
python-numpy \
python-pip \
software-properties-common \
swig \
zip \
zlib1g-dev
The following error is displayed:
bash: sudo: command not found
Step 1: Install the 'sudo' command To achieve this, log in or switch to root user and use the APT package manager to update the system package list. Then install sudo as shown. When prompted to continue. hit 'Y' to proceed.
Before attempting to fix this error double check the syntax to ensure the command you're trying to run is correct. If you haven't done so yet you'll need to enable the root user, this may be all that's needed to fix the error.
-bash: sudo: command not found Error and Solution Step #1: Become a root user. When prompted you need to type the root user’s password. Step #2: Install sudo tool under Linux. Reading package lists... Done Building dependency tree Reading state information. Step #3: Add admin user to /etc/sudoers. ...
This error means the sudo command is not installed. The sudo command allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. When prompted you need to type the root user’s password.
docker comes along with root it doesnt require sudo. now you can use sudo along with your command in docker... Show activity on this post. Docker images typically do not have sudo, you are already running as root by default. Try If you wish to not run as root, see the Docker documentation on the User command.
Most of the Linux distributions provides the sudo command in order to run different tools and commands with root privileges. A regular user can run tools and commands with root privileges by using the sudo but the user should be configured to access sudo command.
docker comes along with root it doesnt require sudo.
BTW if you want sudo in docker if you want to install sudo
,
try this,
apt-get update && \
apt-get -y install sudo
now you can use sudo along with your command in docker...
Docker images typically do not have sudo
, you are already running as root
by default. Try
apt-get update && apt-get install -y build-essential curl git libfreetype6-dev libpng12-dev libzmq3-dev pkg-config python-dev python-numpy python-pip software-properties-common swig zip zlib1g-d
If you wish to not run as root, see the Docker documentation on the User command.
We don't want to weaken the security of the container by installing sudo in it. But we also don't want to change existing scripts that work on normal machines just so that they work in docker, which doesn't need the sudo.
Instead, we can define a dummy bash script to replace sudo, which just executes the arguments without elevating permissions, and is only defined inside the docker image.
Add this to your Dockerfile:
# Make sudo dummy replacement, so we don't weaken docker security
RUN echo "#!/bin/bash\n\$@" > /usr/bin/sudo
RUN chmod +x /usr/bin/sudo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With