installed the docker from binaries + docker startup - docker

we installed the docker from binaries as the following ( according to https://docs.docker.com/engine/install/binaries/ )
wget https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz
--2020-05-06 20:39:22-- https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz
Resolving download.docker.com (download.docker.com)... 13.225.249.16, 13.225.249.45, 13.225.249.106, ...
Connecting to download.docker.com (download.docker.com)|13.225.249.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27816900 (27M) [application/x-tar]
Saving to: ‘docker-17.03.0-ce.tgz’
100%[===================================================================================================================================================>] 27,816,900 4.76MB/s in 3.7s
2020-05-06 20:39:26 (7.11 MB/s) - ‘docker-17.03.0-ce.tgz’ saved [27816900/27816900]
now we tar it
tar xzvf docker-17.03.0-ce.tgz
docker/
docker/docker-containerd-ctr
docker/docker-proxy
docker/docker
docker/docker-containerd
docker/dockerd
docker/docker-init
docker/docker-containerd-shim
docker/docker-runc
the files after untar
# ls
docker docker-17.03.0-ce.tgz hsperfdata_root stable
cd docker/
# ls
docker docker-containerd docker-containerd-ctr docker-containerd-shim dockerd docker-init docker-proxy docker-runc
now we need to start the dockerd
but how to start it
we try y
/tmp/docker/dockerd
Failed to connect to containerd. Please make sure containerd is installed in your PATH or you have specified the correct address. Got error: exec: "docker-containerd": executable file not found in $PATH
so where we are wrong here ?

First you need to download and run containerd from containerd,
start it containerd& and then run dockerd &, after that you can try it docker run hello-world
It is not recommended way, better install it from repository with selinux or apparmor profiles.

Related

could not parse ssh: [default]: stat /tmp/ssh-qpL02JZP5k7x/agent.28198: no such file or directory

AFAIK the error means that there is no file named agent.28198 in the mentioned directory, but upon listing its contents the file (local socket file) is clearly there. What could be the reason for docker's inability to get the socket?
Here is the full command scenario:
$ eval $(ssh-agent -s)
Agent pid 28199
$ ssh-add
Enter passphrase for /home/ubuntu/.ssh/id_rsa:
Identity added: /home/ubuntu/.ssh/id_rsa (/home/ubuntu/.ssh/id_rsa)
$ DOCKER_BUILDKIT=1 docker build --ssh default -t my_image .
could not parse ssh: [default]: stat /tmp/ssh-qpL02JZP5k7x/agent.28198: no such file or directory
$ ls -l /tmp/ssh-qpL02JZP5k7x/
total 0
srw------- 1 ubuntu ubuntu 0 Sep 9 08:50 agent.28198
Docker is installed from snap - that's the culprit. It does not have access to /tmp folder because of that. To remediate, remove the package from snap - sudo snap remove docker and install it via dpkg (link).

how to change root dir of docker on ubuntu 18.04 LTS? (docker change location of volumes)

I installed ubuntu 18.04 LTS and checked a setting for docker (17.06.2-ce) to install at the same time.
I tested by starting the hello-world (sudo docker run hello-world) :
[...]
Hello from Docker!
This message shows that your installation appears to be working correctly.
[...]
I mounted a software raid on the folder named /raid, and make a folder /docker-data in it.
I try to change the root dir of my docker to put it in /raid/docker-data/ by following the few tutorials on the network... in vain.
these solutions don't work either :
/etc/default/docker : I can't find this
As in the 2nd solution : docker can't find his folder.
Docker Root Dir: /var/snap/docker/common/var-lib-docker
Has anyone managed to do this feat in recent months?
(this is my 3rd installation of ubuntu and I just broke it...)
Apparently on Ubuntu 18.04 LTS, docker 17.06.2-it needs to work with snap, I'm going to dig this way. I will try to return answer later...
The common solution is to move the data and create a symlink:
systemctl stop docker
mv /var/lib/docker /raid/docker-data
ln -s /raid/docker-data /var/lib/docker
systemctl start docker
You can also tell docker about the new location with a setting in /etc/docker/daemon.json. If you don't have this file, you could create one with the contents:
{
"data-root": "/raid/docker-data"
}
I would recommend the first solution since you will find many 3rd party tools expect docker to be located in /var/lib/docker.
Sorry for this late response.
to come to my problem, after having looked at it more closely:
I am on Ubuntu 18.04, I can add or remove the docker service only via snap install (or remove) docker.
a docker party installs in /var/snap/
so I transpose your solution like this:
mv /var/snap/ /raid/snap
ln -s /raid/snap /var/snap
and finally I install docker via snap install docker
I have a test with sudo docker info, and I have this error message that appears :
cannot perform operation: mount --rbind /var/snap /tmp/snap.rootfs_RRAjdq//var/snap: Permission denied
(snap.rootfs_* because the end does not stop changing at each command launch)
and yet the installation went well some docker is apparently of course on /raid/snap.
I come back to you to give you the solution that allowed me to solve this problem.
cannot perform operation: mount --rbind /var/snap /tmp/snap.rootfs_RRAjdq//var/snap: Permission denied
I know why : https://bugs.launchpad.net/snapcraft/+bug/1620771 :
When /home is a symlink snaps don't work.
When /home is a real directory snaps work, see output below
In my case :
When /raid/snap is a symlink snaps don't work.
When /var/snap is a real directory snaps work.
I deleted docker. I had to reinstall snapcraf (snapd) because I was left on file modifications of it (wrong way)
from there, I stopped the snapd service:
sudo mv /var/snap/ /raid/snap
sudo mount --rbind /raid/snap /var/snap
I started the snapd service.
sudo snap install docker
sudo docker info <= to test
sudo docker run hello-world <= to test
I fixed my mount on fstab:
/raid/snap /var/snap none bind
I restarted my OS : it worked, at least for my case. (I checked all along this file consistency handling to see if the docker files was going well on the raid...)
Change Docker root storage (data path):
run this command to find docker data path:
$ sudo docker info | grep -i root
default path:
root#user-testing-HP-ProBook-4540s:/etc/docker# docker info | grep -i root
Root Dir: /var/lib/docker/aufs
WARNING: No swap limit support
Docker Root Dir: /var/lib/docker
first, stop the docker:
sudo service docker stop
copy the corrent data path to new path:
sudo rsync -aqxP /var/lib/docker /data/docker-data/
add the following on (/etc/docker/daemon.json) file:
(if the file is not there create the file with vim or your fav editor(sudo vim /etc/docker/deamon.json) )
{
"data-root": "/data/docker-data/docker"
}
conform with cat command:
cat /etc/docker/deamon.json
output will be like this:
root#user-testing-HP-ProBook-4540s:/home/user/Downloads# cat /etc/docker/daemon.json
{
"data-root": "/data/docker-data/docker"
}
root#user-testing-HP-ProBook-4540s:/home/user/Downloads#
start docker:
sudo service docker start
check the root (data path) path now:
$ sudo docker info | grep -i root
out put will be like this:
root#user-testing-HP-ProBook-4540s:/home/user/Downloads# sudo docker info | grep -i root
Root Dir: /data/docker-data/docker/aufs
WARNING: No swap limit support
Docker Root Dir: /data/docker-data/docker
root#user-testing-HP-ProBook-4540s:/home/user/Downloads#

zsh: command not found: dcos

I tried to install DC/OS cluster on my Mac by dcos-vagrant.
Intsallation is quite smooth, no errors found.
==> m1: sudo: chmod u+x /opt/mesosphere/bin/postflight.sh
==> m1: sudo: /opt/mesosphere/bin/postflight.sh
==> boot: DC/OS Installation Complete
==> boot: Web Interface: http://m1.dcos/
but when I opne the http://m1.dcos/, doesn't show the web-ui, show the ERR_EMPTY_RESPONSE error, and cannot find the dcos command.
GET http://m1.dcos/ net::ERR_EMPTY_RESPONSE
➜ dcos-vagrant git:(master) dcos marathon app add https://dcos.io/docs/1.7/usage/nginx.json
zsh: command not found: dcos
Anyone can help me! Thanks in advance!
dcos cannot work duo to I didn't install the dcos CLI.
intallation DC/OS CLI
To install the CLI, copy and paste into your terminal:
mkdir -p dcos
cd dcos
curl -O https://downloads.dcos.io/dcos-cli/install.sh
bash ./install.sh . https://m1.dcos
source ./bin/env-setup
Empty response from http://m1.dcos/ would seem to indicate the UI service or admin router is having issues, but the CLI working means admin router is reachable and correctly proxying components like Marathon & Mesos.
You might check the admin router logs to see if it's having trouble serving the UI html/js.
Status:
systemctl status dcos-adminrouter.service
Logs:
journalctl -u dcos-adminrouter

Docker: Error pulling image, executable file not found in $PATH

I'm trying to pull some image, and have strange error:
sudo docker pull wnameless/oracle-xe-11g
Pulling repository wnameless/oracle-xe-11g
f8d224b82290: Error pulling image (latest) from wnameless/oracle-xe-11g, Untar exit status 1 exec: "xz": executable file not found in $PATH found in $PATH ror downloading dependent layers
2014/11/28 23:08:26 Error pulling image (latest) from wnameless/oracle-xe-11g, Untar exit status 1 exec: "xz": executable file not found in $PATH
Strange, but Ubuntu image works fine
sudo docker run -i -t ubuntu
System version:
Linux Mint 17 Qiana
Kernel version 3.13.0
Issue 9327 was introduced in 1.3.2 and should be fixed in 1.4.0, so 1.3.1 should be fine (beside lack of security fixes which caused this regression). If you creating images with mkimage.sh in 1.3.2 next fix will help:
$ > git diff
diff --git a/contrib/mkimage.sh b/contrib/mkimage.sh
index cd2fa74..fda16ab 100755
--- a/contrib/mkimage.sh
+++ b/contrib/mkimage.sh
## -71,7 +71,7 ## nameserver 8.8.8.8
nameserver 8.8.4.4
EOF
-tarFile="$dir/rootfs.tar.xz"
+tarFile="$dir/rootfs.tar.bz2"
touch "$tarFile"
(
## -82,7 +82,7 ## touch "$tarFile"
echo >&2 "+ cat > '$dir/Dockerfile'"
cat > "$dir/Dockerfile" <<'EOF'
FROM scratch
-ADD rootfs.tar.xz /
+ADD rootfs.tar.bz2 /
EOF
# if our generated image has a decent shell, let's set a default command
As result, this problem was only in latest version of Docker (lxc-docker package, version > 1.3.x). I have removed this package, and install docker.io package (v. 1.0.1). Now everything is fine.

docker: how to restart containers from files from /var/lib/docker/containers

I have updated my distro from 13.04 to 13.10 and had a bunch of running containers. the container files are still in /var/lib/docker/container however I can not start these:
$ sudo docker start 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
Error: No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
2014/03/25 05:18:14 Error: failed to start one or more containers
$ sudo tail /var/log/upstart/docker.log
2014/03/25 05:11:19 POST /v1.10/images/create?fromImage=7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65&tag=
[/var/lib/docker|5227412d] +job pull(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65, )
HTTP code: 404
[/var/lib/docker|5227412d] -job pull(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65, ) = ERR (1)
2014/03/25 05:18:14 POST /v1.10/containers/7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65/start
[/var/lib/docker|5227412d] +job start(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65)
No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
[/var/lib/docker|5227412d] -job start(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65) = ERR (1)
[error] server.go:950 Error: No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
[error] server.go:85 HTTP Error: statusCode=404 No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
debug log from docker startup
[debug] runtime.go:300 Cannot load container 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65 because it was created with another graph driver.
inspecting driver which this container was created with:
$ cd /var/lib/docker/containers/7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
$ cat ./config.json | grep -o Driver.*\",
Driver":"aufs","ExecDriver":"lxc-0.9.0",
is there any way to recover these?
Turns out after updating aufs was uninstalled. reinstalling like so:
sudo apt-get update
sudo apt-get install linux-image-extra-`uname -r`
fixes issue!

Resources