How to figure out if docker master or agent running?
I do sudo docker version and this is what I get:
$ sudo docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.3.3
Git commit (client): a8a31ef/1.5.0
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.3.3
Git commit (server): a8a31ef/1.5.0
Is this a docker agent or a docker master? Is the master the daemon or the agent... or both?
Your output explicitly says:
Client version: 1.5.0
That is the version of your docker client - that command line tool - which you were using to get those information.
Server version: 1.5.0
That is the version of your docker server (or host, or daemon).
But what do you mean with agents? I do not know that term in the Docker context.
On a server you could start containers with docker run commands issued by the client. For a container you can get information about which image and tag is used by typing docker inspect --format='{{.Config.Image}}' <containerName>.
I just use docker ps and see if it works, I think this is the client, docker should be executed via systemctl
Related
I want to be able to use the --squash switch when building docker images as this shaves several MB of the result image.
This requires experimental features enabled for docker.
Executing a docker --version confirms (as it should) experimental features to be off on hosted Azure Pipelines agents.
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:15:30 2018
OS/Arch: linux/amd64
Experimental: false
Linux agents are running
Kernel Version: 4.15.0-1022-azure
Operating System: Ubuntu 16.04.4 LTS
OSType: linux
Architecture: x86_64
I've tried altering /etc/systemd/system/docker.service.d/docker.conf and /etc/docker/daemon.json to start with/include experimental flags, but didn't succeed in enabling it.
docker.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --experimental=tr
or
daemon.json
{
"experimental": true
}
But don't unsure if I can restart the daemon on a hosted agent.
Currently doing yaml builds invoking docker from bash, but didn't see anything around experimental in the web interface either.
If i spin up my own Ubuntu VM and host an agent on that, experimental works, but want to avoid cost and maintenance by using the hosted agents.
In the Ubuntu Image you can simply restart the docker service, after the daemon.json is updated. I use a script with two lines:
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo service docker restart
Enabled it using the following script before the docker build task in my pipeline.
- script: |
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo service docker restart
displayName: 'Enable docker experimental features for squashing '
Why does my Docker client recognize docker build but not docker image build? Is the client too old? Does CLI depends on client or server?
I believe I got my Docker client and server by installing the latest Docker toolbox.
$ docker version
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 06:14:34 2016
OS/Arch: windows/amd64
Server:
Version: 18.01.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: 03596f5
Built: Wed Jan 10 20:13:12 2018
OS/Arch: linux/amd64
$ docker image build
docker: 'image' is not a docker command.
See 'docker --help'.
$ docker build
"docker build" requires exactly 1 argument(s).
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
The client version is old. The new commad structure is supported with client 1.13. Check Docker CLI restructured.
There was a refactoring for the command line client to have the form:
docker <management command> <command>
The new command structure still supports the old way. For instance, the old docker ps is an alias for docker container ls and the old docker build is alias to docker image build.
As you can see from the documentation in your client version docker image build does not exist yet.
I want to Running Docker Containers on Marathon,
So I start the mesos-slave with --containerizers=docker,mesos
/usr/local/Cellar/mesos/0.22.1/sbin/mesos-slave --master=zk://localhost:2181/mesos --log_dir=/Users/wangyao/WorkAndLog/mesos/log --work_dir=/Users/wangyao/WorkAndLog/mesos/work --containerizers=docker,mesos
I1216 11:17:16.407368 2038878976 logging.cpp:172] INFO level logging started!
I1216 11:17:16.407878 2038878976 main.cpp:156] Build: 2015-05-12 19:28:23 by brew
I1216 11:17:16.407896 2038878976 main.cpp:158] Version: 0.22.1
Failed to create a containerizer: Could not create DockerContainerizer: Failed to execute 'docker version': exited with status 1
it told me "Failed to execute 'docker version'" ,
and I execute "docker version"
wangyaos-MacBook-Pro-2:~ wangyao$ docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64
Get http:///var/run/docker.sock/v1.19/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
My questions:
what is 'docker version' use for?
in order to start mesos with --containerizers=docker,mesos, do I need to install docker on my Os ?
how to solve this issue "Failed to execute 'docker version'"?
The "Running Docker Containers on Marathon" uses Docker, which means you need to have a Linux host.
If you are on Mac OS, you would need to install docker-toolbox in order to get a VirtualBox VM (Virtual Machine) on which you can have docker.
docker version displays the version of the docker client and docker server: the server part fails, since it does not run on top of a Linux kernel (but a Mac one).
docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8/1.4.1
OS/Arch (client): linux/amd64
FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
please lte me know y it is giving this error .i m using rhel 6.4
As comments suggested probably Docker daemon is not running. AFAIK, docker is not supported for RHEL 6.4. Check Docker documentation:
Red Hat Enterprise Linux 6.5 Installation
You will need 64 bit RHEL 6.5 or later, with a RHEL 6 kernel version
2.6.32-431 or higher as this has specific kernel fixes to allow Docker to work.
Docker is available for RHEL6.5 on EPEL. Please note that this package
is part of Extra Packages for Enterprise Linux (EPEL), a community
effort to create and maintain additional packages for the RHEL
distribution. Kernel support
RHEL will only support Docker via the extras channel or EPEL package
when running on kernels shipped by the distribution. There are things
like namespace changes which will cause issues if one decides to step
outside that box and run non-distro kernel packages.
Warning: Please keep your system up to date using yum update and rebooting your system. Keeping your system updated ensures critical security vulnerabilities and severe bugs (such as those found in kernel 2.6.32) are fixed.
with a fresh installation: (notice the sudo at the beginning)
$ sudo service docker start
$ sudo docker run hello-world
worked for me
I have setup the private registry using docker run -t -i -p 5000:5000 registry and it is accessible from 192.168.59.103:5000 (I am using boot2docker). Now I have already pulled an image tutum/tomcat and when I try to push the image (docker push 192.168.59.103:5000/tomcat) into the registry after tagging it as 192.168.59.103:5000/tomcat I face the following error as shown below --
FATA[0004] Error: v1 ping attempt failed with error: Get https://192.168.59.103:5000/v1/_ping: EOF. If this private regi
stry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.59.103:5000` to
the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag
; simply place the CA certificate at /etc/docker/certs.d/192.168.59.103:5000/ca.crt
FROM OTHER POSTS --
I have read some some posts about this where they state that adding DOCKER_OPTS would solve the issue and that it should be added into /etc/default/docker but In my system /etc/default doesn't contain a docker folder as shown from the command sudo ls /etc/default/ which provides the result as a sungle folder aufs.
Another post states that this can be thrawted by simply placing the certificate att /etc/docker/certs.d/192.168.59.103:5000/ca.crt but I am not able to move into the docker directory even when I use sudo as seen below -- for cd /etc/docker
-sh: cd: can't cd to /etc/docker
I have repeated the same process using the registry ip as 0.0.0.0:5000 inside docker (with the assumption the that $boot2docker ip should be used in the hosts machine and not within docker) -- But that still didn't fix the issue that I am facing.
Please do help me out to sort out this problem. I have added the system specification below --
System Specification:
Microsoft Windows 7 via. boot2docker (CLI version 1.5)
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef
To use the --insecure-registry option, add it to the file /var/lib/boot2docker/profile inside the boot2docker VM. You can get into the VM with boot2docker ssh. The file contents should look like:
EXTRA_ARGS="--insecure-registry REGISTRY_IP:PORT"
You will then need to restart boot2docker (e.g. boot2docker restart).
I have no idea why you can't edit /etc/docker. The following works for me:
docker#boot2docker:~$ sudo ls /etc/docker
key.json