Docker - Bash: IP: command not found - docker

I'm currently trying to set up a hyperledger fabric network using docker toolbox, based on the guide HERE
When it comes to "Starting up validating peers" step, I followed and entered ip add into the terminal, but it returns bash: ip: command not found. Any solution? I've tried ifconfig as well and it's the same issue, command not found.
Using Docker Toolbox on Windows 10 Home

Install ip command package for Ubuntu.
apt update
apt install iproute2

I have tried hostname -I. Working fine for me.No need to install a new package.

Unfortunately, your link has been broken (or it might be inaccessible from Iran). Although there is not enough evidence of which Linux OS you are trying to use, a solution is provided as follow work under .deb (e.g. Ubuntu) and .rpm (e.g. Fedora) package managers.
At first, update the container's repository:
Ubuntu:
apt-get update
CentOS:
yum update
Fedora:
dnf update
Secondly, install net-tools package.
Ubuntu:
apt-get install net-tools
CentOS:
yum install net-tools
Fedora:
dnf install net-tools
Lately, ifconfig has been replaced with ip command. So make sure to check both commands, some Linux distributions have not changed the command yet.

for command ip not found in centos 7, you can use yum install iproute -y to fix.
for command ifconfig not found in centos 7, you can use yum install net-tools -y to fix.

Although OP was on Windows 10. I landed on this question searching for a fix for macOS and didn't find this answer for a while. So I'm linking it here as well just in case
You can install ip tool on OS X via brew:
brew install iproute2mac

Your link doesn't work.
Do docker ps or docker images in GitBash to see if the docker containers and images are running.
I recommend installing Docker Community Edition if you are running Win 10. Make sure u have Hyper-V enabled.

Related

exec: "com.docker.cli": executable file not found in $PATH although it does exist?

I have been struggling with the issue of "docker" command not being recognized in Windows cmd. I have docker installed on Windows Pro, and it is running ok, but the "docker" command is not recognized though the PATH variable contain the location of the docker binaries.
Any ideas on this, please? I have been looking everywhere, but could not find a solution!
Thanks.
I encontered the same problem. In my case (linux) it was because of broken installations. I've ran sudo apt --fix-broken install && sudo apt install docker-ce docker-ce-cli containerd.io
(Windows): I did not use my PC for a year, and got the same error after running docker --version. I just upgraded to the latest docker version, and issue resolved.

nvidia-docker with nvidia-cuda-toolkit not working between different hosts

I have two machines with different OS. One is ubuntu 18.04 and the other is debian buster. Both of them have docker installations ( from here ) and and the latest nvidia-docker installed. Both systems have a gpu which I want to use inside the containers. So I created a dockerfile which will install everything I require.
FROM ubuntu:18.04
RUN apt update -y
RUN apt upgrade -y
RUN apt install \
nvidia-cuda-toolkit \
-y
In the first machine which has as host ubuntu and a gpu that require .435 driver to work it works fine (docker run --rm --gpus all my-image:1 nvidia-smi)
But when I try the same dockerfile with 0 changes on my Debian machine it will return missmatched version of drivers.
The second matching which has as a host debian and a gpu that require .418 dirver to work it complains about missmatched versions.
Isn't supposed to be host independent installation ? What am I missing and I cannot build the same Dockerfile in both systems?
I can see toolkit bringing drivers on its own but as it is apt installation I have no control over it.
Thank you in advance

Installed docker and I got podman

Installed docker on Centos (running using VirtualBox) following steps below:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum install docker
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
And I rebooted my virtual machine, and as I type 'docker --version, I get below:
"Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. podman version 1.0.5"
Can anybody explain what is going on in my machine?
#swxraft if you run the commands in the order posted in your question
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum install docker
sudo yum-config-manager --add-repo
https://download.docker.com/linux/centos/docker-ce.repo
you installed a docker in the REHL repo (probably an alias to podman). And then loaded the repo for the oficial docker but never installed from there.
Extra info:
A) installation docker
How to install docker: follow this link [1] instead #govinda-malavipathirana. Latest docker-ce needs a newer containerd.io but REHL is excluding the ones in the docker repo. So you need to install docker -ce with --nobest (see instructions and error in link). Also you need to disable the firewall.d to have DNS in docker.
B) why docker is not in REHL8
Docker cli and daemon are not supported by REHL8 and its derivatives and it is "blocked" in several ways. Why is not suported -> monolitic and old [2]
Docker images ARE supported using podman. The images created with docker work with podman and viceversa. Also podman commands are the same as docker client.
Podman is a substitute of docker (but it does not use a daemon). They recommend to add a symlink docker -> podman and you will not notice the difference [3]
[1]https://linuxconfig.org/how-to-install-docker-in-rhel-8
[2]http://crunchtools.com/why-no-docker/
[3]https://developers.redhat.com/blog/2019/02/21/podman-and-buildah-for-docker-users/
Docker will not support RedHat 8, it will be installed as Podman.
So you can try it with Amazon linux2 instead of RedHat.
You have to create a new instance in AWS with Amazon linux2, then it will work.
Since docker is not officially supported by REHL8/CentOS8. You have to install it by additional steps.
This is a good article I have found in the internet, shows how to install docker in CentOS 8.
https://computingforgeeks.com/install-docker-and-docker-compose-on-rhel-8-centos-8

download and run ubuntu-desktop with gnome support via docker

I am completely new to docker. I have a Redhat 7 desktop with docker installed.
I now want to run a full fledged ubuntu-desktop 18.04 (including its gnome GUI) via docker. How can this be done? I have been googling for instructions/tutorials on where I can download an ubuntu 18.04 docker image (with GUI support) and run it, but surprisingly I cannot find anything. Can someone help me? Thanks.
I have a different situation, where I run docker on a Windows10 platform. I also tried to install Gnome for some Ubuntu image and start a gnome-session from the terminal. I did not manage to do so.
My current solution is to use Mate instead of Gnome. Maybe my steps are helpful for others that just started with docker:
Install Docker Desktop on Windows 10 and start the Docker application
Install vcxsrv and start it with Xlaunch (also see https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde)
Get the IP of your computer with ipconfig, e.g 192.111.999.9
Open a console with admin rights and start a docker container. Pass some DISPLAY-Information including your IP:
docker run -it -e DISPLAY=192.111.999.9:0.0 --privileged --name=ubuntu ubuntu
You should then see a linux prompt
Update the package-manager and upgrade existing packages:
apt-get update
apt-get upgrade -y
apt-get update
start dbus service to avoid dbus warnings (also see https://georgik.rocks/how-to-start-d-bus-in-docker-container/):
dbus-uuidgen > /var/lib/dbus/machine-id
mkdir -p /var/run/dbus
dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address
install mate (and some themes to avoid theme warning)
apt-get install mate-desktop-environment -y
apt-get ubuntu-mate-themes -y
start a Desktop session with
mate-session
Good luck!
(If you want some more programs, instead of "mate-desktop-environment", you can also use the larger package "ubuntu-mate-desktop". Will take > 10 min to be installed.)
This is an atypical use case for Docker. Docker is normally used to run applications via the command line, or on a server without GUI support. Most operating systems in docker images ship without GUI support.
However, you can enable GUI support with X11. Only with containers that support it though, and not with Ubuntu as far as I can tell. More details on this blog post: https://blog.jessfraz.com/post/docker-containers-on-the-desktop/
For now, just run docker run -it --rm ubuntu:latest bash and you'll launch an Ubuntu 18.04 shell (at the time of this post).

Docker-engine confilcts with docker.io

OS: Ubuntu 16.04
Docker version: 1.11.2
I have already installed docker 1.11.2 on my Ubuntu and I want to upgrade it to 1.12. All the steps are as follows:
I download the deb pkg named docker-engine_1.12.3-0~xenial_amd64.
Execute command: dpkg -i docker-engine_1.12.3-0~xenial_amd64 but notes with errors:
docker-engine conficts with docker.io.docker.io (version 1.11.2-0ubuntu5~16.04) has already been installed .
So I have to remove docker first by using commands as below:
service docker stop
apt-get remove docker
apt-get remove --auto-remove docker
rm -rf /var/lib/docker
Go to step 2, but with the same errors.
So, I hope someone would help me solve this problem.
The conflicting packages (which fight over the same binary) are docker.io (from the distribution) and docker-engine (from Docker itself).
Your command above does apt-get remove ... docker. Which achieve nothing for the aforementioned problem.
I have different machines running 16.04 and some use docker.io (easier, no extra repo) whereas others use docker-engine. I am indifferent. Pick on, docker should work just fine.
Firstly restart the ubuntu server with linux command(sudo shutdown -r now), and run the command : apt-get -f install(this command is suggested by the error information), then I install the docker-engine by the following site(https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04).

Resources