-
Notifications
You must be signed in to change notification settings - Fork 0
Home
- CE is free and EE is paid per node
- Actually EE is just for big company requiring LDAP authentication, support and so.
- Edge is beta release mothly based, more features but just suported for 1 month
- Stable is the one which comes once a quarter, so they are supported for 4 months just after the next stable release.
The syntax changed to
docker <command> <sub_command> (options)
Before and still is working:
docker <command> (options)
-
docker versionjust show the version -
docker infoit will show much more than that For example how many containers are running, how many images are installed and so...
This will just show the configuration of the specified container
docker container inspect container_name
For example:
[
{
"Id": "4793f8a12980b98293860f5760886d16dd6a509fa71b656aa0d906d565cdf042",
"Created": "2018-12-05T21:53:05.93797098Z",
"Path": "docker-entrypoint.sh",
"Args": [
"mysqld"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1346,
"ExitCode": 0,
"Error": "",
"StartedAt": "2018-12-05T21:53:06.233443685Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:f991c20cb5087fdd01fa7a2181f0a123a54d697681cf3723370bf50566d2e7cf",
"ResolvConfPath": "/var/lib/docker/containers/4793f8a12980b98293860f5760886d16dd6a509fa71b656aa0d906d565cdf042/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/4793f8a12980b98293860f5760886d16dd6a509fa71b656aa0d906d565cdf042/hostname",
"HostsPath": "/var/lib/docker/containers/4793f8a12980b98293860f5760886d16dd6a509fa71b656aa0d906d565cdf042/hosts",
"LogPath": "/var/lib/docker/containers/4793f8a12980b98293860f5760886d16dd6a509fa71b656aa0d906d565cdf042/4793f8a12980b98293860f5760886d16dd6a509fa71b656aa0d906d565cdf0$
"Name": "/mysql",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/527735eeec9cd54797f428f42813017e773c80d360e7702ef763a86d0cbf9224-init/diff:/var/lib/docker/overlay2/f70ff4b52b8a4606194d$
"MergedDir": "/var/lib/docker/overlay2/527735eeec9cd54797f428f42813017e773c80d360e7702ef763a86d0cbf9224/merged",
"UpperDir": "/var/lib/docker/overlay2/527735eeec9cd54797f428f42813017e773c80d360e7702ef763a86d0cbf9224/diff",
"WorkDir": "/var/lib/docker/overlay2/527735eeec9cd54797f428f42813017e773c80d360e7702ef763a86d0cbf9224/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "8c8e8f12230d243ce6b207de6c0dc523ad509d5fffcba78adb9912eb3aa739af",
"Source": "/var/lib/docker/volumes/8c8e8f12230d243ce6b207de6c0dc523ad509d5fffcba78adb9912eb3aa739af/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "4793f8a12980",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_ROOT_PASSWORD=true",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=8.0",
"MYSQL_VERSION=8.0.13-1debian9"
],
"Cmd": [
"mysqld"
],
"ArgsEscaped": true,
"Image": "mysql",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "33c0c953c2ddf03154cca043035d12f318f904c489c57d5c4d69c7a231eebc52",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": null,
"33060/tcp": null
},
"SandboxKey": "/var/run/docker/netns/33c0c953c2dd",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "5c4671c1ef240a818aea7c448092622393cea9d5c83713a5babd6de9178708d7",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "e9aad43ae1bd78030a35314306810311578c42ac273b8028580db4b7604a8a93",
"EndpointID": "5c4671c1ef240a818aea7c448092622393cea9d5c83713a5babd6de9178708d7",
"SandboxID": "33c0c953c2ddf03154cca043035d12f318f904c489c57d5c4d69c7a231eebc52",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": null,
"33060/tcp": null
},
"SandboxKey": "/var/run/docker/netns/33c0c953c2dd",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "5c4671c1ef240a818aea7c448092622393cea9d5c83713a5babd6de9178708d7",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "e9aad43ae1bd78030a35314306810311578c42ac273b8028580db4b7604a8a93",
"EndpointID": "5c4671c1ef240a818aea7c448092622393cea9d5c83713a5babd6de9178708d7",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:03",
"DriverOpts": null
}
}
}
}
]This will just show the logs of the specified container
docker container logs container_name
For deleting containers
docker container rm container_name
- If you want to force delete a running container for example use
docker container rm -f container_name
-
Whenever we invoke
docker container run, we create a new container this is the main difference withdocker start -
Also if we do not specify a name using the parameter:
--namedocker will assing an unique name for our container.-
nginx in the 80 for example for having attached session _
docker container run --publish 80:80 --name web1 nginxthis is equivalent to the old way:docker run -p 80:80 nginx -
nginx in the 80 for example for having dettach session
docker container run --publish 80:80 --detach nginxthis is equivalent to the old way:docker run -p 80:80 -d nginx
-
So what's it actually happening when we execute this command is:
- Looks for the nginx image locally, if it doesn't find int it downloads it from internet (nginx:latest)
- Creates a new container based in the image
- Gives a virtual IP on a private Network inside docker engine.
- OPens up the port 80 and forward it to the 80 in container
- Start container using the CMD inside the Dockerimage
This will show the processes running inside the specified container
docker container top container_name
This will show the performance of the the specified container
docker container stats container_name