Performance Analysis with Docker

I am demonstrating how dockers is better in terms of performance compared to a VM. Using sysbench, a micro benchmark used to measure performance of CPU/Memory/HDD, i will be demonstrating “sysbench running in a Docker” vs “sysbench running in a VM”.

I have a standalone / bare metal box (Host) with rhel7.5 installed on it. I have created a rhel7.5 VM where sysbench’s cpu benchmark is run and used as a measure to quantify docker with  a VM performance.

 

A) Dockerfile: (CPU workoad)

FROM centos:latest

RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | bash
RUN yum -y install sysbench
CMD [“sysbench”, “–threads=31”, “–cpu-max-prime=1000”, “cpu”, “run”]

 

B)

-bash-4.2# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
lambzee/sysbench latest ec033d4c4a90 35 minutes ago 362MB
<none> <none> 8c74b451f649 37 minutes ago 362MB
<none> <none> cddacf83b468 39 minutes ago 362MB
<none> <none> ce7451874a1b About an hour ago 362MB
<none> <none> 4832fc2eafb5 About an hour ago 202MB
lambzee/catnip latest 8e56323c21b5 13 hours ago 700MB
busybox latest d8233ab899d4 3 days ago 1.2MB
registry 2 d0eed8dad114 2 weeks ago 25.8MB
alpine latest caf27325b298 2 weeks ago 5.53MB
hello-world latest fce289e99eb9 6 weeks ago 1.84kB
centos latest 1e1148e4cc2c 2 months ago 202MB
jenkinsci/blueocean latest 128631e0a9ef 6 months ago 442MB
python 3-onbuild 292ed8dee366 7 months ago 691MB
prakhar1989/static-site latest f01030e1dcf3 3 years ago 134MB
-bash-4.2#

 

HOST:

-bash-4.2# sysbench –threads=31 –cpu-max-prime=1000 cpu run
sysbench 1.1.0-18a9f86 (using bundled LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 31
Initializing random number generator from current time
Prime numbers limit: 1000

Initializing worker threads…

Threads started!

CPU speed:
events per second: 866392.87

Throughput:
events/s (eps): 866392.8729
time elapsed: 10.0002s
total number of events: 8664142

Latency (ms):
min: 0.03
avg: 0.04
max: 4.05
95th percentile: 0.04
sum: 307785.97

Threads fairness:
events (avg/stddev): 279488.4516/3333.41
execution time (avg/stddev): 9.9286/0.01

 

C) docker run lambzee/sysbench:latest

DOCKER:

-bash-4.2# docker run lambzee/sysbench:latest
sysbench 1.0.16 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 31
Initializing random number generator from current time
Prime numbers limit: 1000

Initializing worker threads…

Threads started!

CPU speed:
events per second: 857156.66

General statistics:
total time: 10.0002s
total number of events: 8572987

Latency (ms):
min: 0.03
avg: 0.04
max: 0.93
95th percentile: 0.04
sum: 307757.11

Threads fairness:
events (avg/stddev): 276547.9677/2703.01
execution time (avg/stddev): 9.9276/0.01

-bash-4.2#

D) Memory workload

Host:

sysbench –threads=50 memory run
sysbench 1.1.0-18a9f86 (using bundled LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 50
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global

Initializing worker threads…

Threads started!

Total operations: 70532349 (7052879.39 per second)

68879.25 MiB transferred (6887.58 MiB/sec)
Throughput:
events/s (eps): 7052879.3933
time elapsed: 10.0005s
total number of events: 70532349

Latency (ms):
min: 0.00
avg: 0.01
max: 37.01
95th percentile: 0.01
sum: 467129.95

Threads fairness:
events (avg/stddev): 1410646.9800/156437.47
execution time (avg/stddev): 9.3426/0.08

=============================================================

Docker:

=============================================================

docker build –tag sysmem .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM centos:latest
—> 1e1148e4cc2c
Step 2/4 : RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | bash
—> Using cache
—> a10fb8bbd2ea
Step 3/4 : RUN yum -y install sysbench
—> Using cache
—> 90762493db64
Step 4/4 : CMD [“sysbench”, “–threads=50”, “memory”, “run”]
—> Running in 3a3e37337d4c
Removing intermediate container 3a3e37337d4c
—> 7edf2e84171a
Successfully built 7edf2e84171a
Successfully tagged sysmem:latest
-bash-4.2#

=============================================================

-bash-4.2# docker run 7edf2e84171a
sysbench 1.0.16 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 50
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global

Initializing worker threads…

Threads started!

Total operations: 88069879 (8805216.54 per second)

86005.74 MiB transferred (8598.84 MiB/sec)
General statistics:
total time: 10.0004s
total number of events: 88069879

Latency (ms):
min: 0.00
avg: 0.01
max: 13.02
95th percentile: 0.01
sum: 474722.50

Threads fairness:
events (avg/stddev): 1761397.5800/40857.85
execution time (avg/stddev): 9.4944/0.04

-bash-4.2#

=============================================================

CPU and Memory both:

-bash-4.2# docker build -t lambzee/syscpumem .
Sending build context to Docker daemon 2.048kB
Step 1/5 : FROM centos:latest
—> 1e1148e4cc2c
Step 2/5 : RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | bash
—> Using cache
—> a10fb8bbd2ea
Step 3/5 : RUN yum -y install sysbench
—> Using cache
—> 90762493db64
Step 4/5 : CMD [“sysbench”, “–threads=31”, “–cpu-max-prime=1000”, “cpu”, “run”]
—> Using cache
—> ec033d4c4a90
Step 5/5 : CMD [“sysbench”, “–threads=50”, “memory”, “run”]
—> Running in 55fabe5f89dd
Removing intermediate container 55fabe5f89dd
—> 634ad20f6941
Successfully built 634ad20f6941
Successfully tagged lambzee/syscpumem:latest
-bash-4.2#

 

docker image – Forcing to not use cache:

-bash-4.2# docker build –no-cache -t lambzee/syscpumem-cache .
Sending build context to Docker daemon 2.048kB
Step 1/5 : FROM centos:latest
—> 1e1148e4cc2c
Step 2/5 : RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | bash
—> Running in 33a86db6260b
Detected operating system as centos/7.
Checking for curl…
Detected curl…
Downloading repository file: https://packagecloud.io/install/repositories/akopytov/sysbench/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures…
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: repo1.ash.innoscale.net
* extras: ftp.usf.edu
* updates: mirror.us-midwest-1.nexcess.net
Retrieving key from https://packagecloud.io/akopytov/sysbench/gpgkey
Importing GPG key 0x04DCFD39:
Userid : “https://packagecloud.io/akopytov/sysbench-prerelease (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>”
Fingerprint: 9789 8d69 f99e e5ca c462 a0f8 cf10 4890 04dc fd39
From : https://packagecloud.io/akopytov/sysbench/gpgkey
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils…
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: repo1.ash.innoscale.net
* extras: ftp.usf.edu
* updates: mirror.us-midwest-1.nexcess.net
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
Nothing to do
Generating yum cache for akopytov_sysbench…
Importing GPG key 0x04DCFD39:
Userid : “https://packagecloud.io/akopytov/sysbench-prerelease (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>”
Fingerprint: 9789 8d69 f99e e5ca c462 a0f8 cf10 4890 04dc fd39
From : https://packagecloud.io/akopytov/sysbench/gpgkey
Generating yum cache for akopytov_sysbench-source…

The repository is setup! You can now install packages.
Removing intermediate container 33a86db6260b
—> 5bb9a69415dd
Step 3/5 : RUN yum -y install sysbench
—> Running in 6b1b1ae15233
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: repo1.ash.innoscale.net
* extras: ftp.usf.edu
* updates: mirror.us-midwest-1.nexcess.net
Resolving Dependencies
–> Running transaction check
—> Package sysbench.x86_64 0:1.0.16-1.el7.centos will be installed
–> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libpq.so.5()(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libmysqlclient.so.18()(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libaio.so.1()(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Running transaction check
—> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
—> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be installed
—> Package postgresql-libs.x86_64 0:9.2.24-1.el7_5 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
sysbench x86_64 1.0.16-1.el7.centos akopytov_sysbench 431 k
Installing for dependencies:
libaio x86_64 0.3.109-13.el7 base 24 k
mariadb-libs x86_64 1:5.5.60-1.el7_5 base 758 k
postgresql-libs x86_64 9.2.24-1.el7_5 base 234 k

Transaction Summary
================================================================================
Install 1 Package (+3 Dependent packages)

Total download size: 1.4 M
Installed size: 6.2 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/libaio-0.3.109-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for libaio-0.3.109-13.el7.x86_64.rpm is not installed
——————————————————————————–
Total 1.3 MB/s | 1.4 MB 00:01
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : “CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-6.1810.2.el7.centos.x86_64 (@CentOS)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 1/4
Installing : postgresql-libs-9.2.24-1.el7_5.x86_64 2/4
Installing : libaio-0.3.109-13.el7.x86_64 3/4
Installing : sysbench-1.0.16-1.el7.centos.x86_64 4/4
Verifying : libaio-0.3.109-13.el7.x86_64 1/4
Verifying : postgresql-libs-9.2.24-1.el7_5.x86_64 2/4
Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 3/4
Verifying : sysbench-1.0.16-1.el7.centos.x86_64 4/4

Installed:
sysbench.x86_64 0:1.0.16-1.el7.centos

Dependency Installed:
libaio.x86_64 0:0.3.109-13.el7 mariadb-libs.x86_64 1:5.5.60-1.el7_5
postgresql-libs.x86_64 0:9.2.24-1.el7_5

Complete!
Removing intermediate container 6b1b1ae15233
—> d84c1dd508a2
Step 4/5 : CMD [“sysbench”, “–threads=31”, “–cpu-max-prime=1000”, “cpu”, “run”]
—> Running in d7ca71ffbb47
Removing intermediate container d7ca71ffbb47
—> a9aa887d92ce
Step 5/5 : CMD [“sysbench”, “–threads=50”, “memory”, “run”]
—> Running in 8705d8e86cc7
Removing intermediate container 8705d8e86cc7
—> 5f62b352a901
Successfully built 5f62b352a901
Successfully tagged lambzee/syscpumem-cache:latest
-bash-4.2#

================ more threads to check exposed ports=========BELOW=========

-bash-4.2# docker build –no-cache -t lambzee/cpu-bench:latest .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM centos:latest
—> 1e1148e4cc2c
Step 2/4 : RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | bash
—> Running in c8b10f729b81
Detected operating system as centos/7.
Checking for curl…
Detected curl…
Downloading repository file: https://packagecloud.io/install/repositories/akopytov/sysbench/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures…
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: ftp.usf.edu
* extras: mirror.us.oneandone.net
* updates: ftp.usf.edu
Retrieving key from https://packagecloud.io/akopytov/sysbench/gpgkey
Importing GPG key 0x04DCFD39:
Userid : “https://packagecloud.io/akopytov/sysbench-prerelease (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>”
Fingerprint: 9789 8d69 f99e e5ca c462 a0f8 cf10 4890 04dc fd39
From : https://packagecloud.io/akopytov/sysbench/gpgkey
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils…
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: ftp.usf.edu
* extras: mirror.us.oneandone.net
* updates: ftp.usf.edu
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
Nothing to do
Generating yum cache for akopytov_sysbench…
Importing GPG key 0x04DCFD39:
Userid : “https://packagecloud.io/akopytov/sysbench-prerelease (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>”
Fingerprint: 9789 8d69 f99e e5ca c462 a0f8 cf10 4890 04dc fd39
From : https://packagecloud.io/akopytov/sysbench/gpgkey
Generating yum cache for akopytov_sysbench-source…

The repository is setup! You can now install packages.
Removing intermediate container c8b10f729b81
—> 30ab22ef87d7
Step 3/4 : RUN yum -y install sysbench
—> Running in 8c02a2218b25
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: ftp.usf.edu
* extras: mirror.us.oneandone.net
* updates: ftp.usf.edu
Resolving Dependencies
–> Running transaction check
—> Package sysbench.x86_64 0:1.0.16-1.el7.centos will be installed
–> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libpq.so.5()(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libmysqlclient.so.18()(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Processing Dependency: libaio.so.1()(64bit) for package: sysbench-1.0.16-1.el7.centos.x86_64
–> Running transaction check
—> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
—> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be installed
—> Package postgresql-libs.x86_64 0:9.2.24-1.el7_5 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
sysbench x86_64 1.0.16-1.el7.centos akopytov_sysbench 431 k
Installing for dependencies:
libaio x86_64 0.3.109-13.el7 base 24 k
mariadb-libs x86_64 1:5.5.60-1.el7_5 base 758 k
postgresql-libs x86_64 9.2.24-1.el7_5 base 234 k

Transaction Summary
================================================================================
Install 1 Package (+3 Dependent packages)

Total download size: 1.4 M
Installed size: 6.2 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/libaio-0.3.109-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for libaio-0.3.109-13.el7.x86_64.rpm is not installed
——————————————————————————–
Total 1.7 MB/s | 1.4 MB 00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : “CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-6.1810.2.el7.centos.x86_64 (@CentOS)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 1/4
Installing : postgresql-libs-9.2.24-1.el7_5.x86_64 2/4
Installing : libaio-0.3.109-13.el7.x86_64 3/4
Installing : sysbench-1.0.16-1.el7.centos.x86_64 4/4
Verifying : libaio-0.3.109-13.el7.x86_64 1/4
Verifying : postgresql-libs-9.2.24-1.el7_5.x86_64 2/4
Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 3/4
Verifying : sysbench-1.0.16-1.el7.centos.x86_64 4/4

Installed:
sysbench.x86_64 0:1.0.16-1.el7.centos

Dependency Installed:
libaio.x86_64 0:0.3.109-13.el7 mariadb-libs.x86_64 1:5.5.60-1.el7_5
postgresql-libs.x86_64 0:9.2.24-1.el7_5

Complete!
Removing intermediate container 8c02a2218b25
—> 9ca25a74de05
Step 4/4 : CMD [“sysbench”, “–threads=56”, “–cpu-max-prime=100000”, “cpu”, “run”]
—> Running in 8362c03c719a
Removing intermediate container 8362c03c719a
—> c6bbc956dcb1
Successfully built c6bbc956dcb1
Successfully tagged lambzee/cpu-bench:latest
-bash-4.2#

Run a local registry

Use a command like the following to start the registry container:

$ docker run -d -p 5000:5000 –restart=always –name registry registry:2

 

docker pull jwholdsworth/dstat

First dstat docker:

Dockerfile:

FROM centos:latest

RUN yum -y install dstat
CMD [“dstat”, “-tcmndylp”, “–top-cpu”]

=========================== docker image – dstat created=====================

-bash-4.2# docker build -t lambzee/dstatmod .
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM centos:latest
—> 1e1148e4cc2c
Step 2/3 : RUN yum -y install dstat
—> Running in c304e3a785f6
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: mirror.teklinks.com
* extras: mirror.dal10.us.leaseweb.net
* updates: repos-tx.psychz.net
Resolving Dependencies
–> Running transaction check
—> Package dstat.noarch 0:0.7.2-12.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
dstat noarch 0.7.2-12.el7 base 163 k

Transaction Summary
================================================================================
Install 1 Package

Total download size: 163 k
Installed size: 752 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/dstat-0.7.2-12.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for dstat-0.7.2-12.el7.noarch.rpm is not installed
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : “CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-6.1810.2.el7.centos.x86_64 (@CentOS)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : dstat-0.7.2-12.el7.noarch 1/1
Verifying : dstat-0.7.2-12.el7.noarch 1/1

Installed:
dstat.noarch 0:0.7.2-12.el7

Complete!
Removing intermediate container c304e3a785f6
—> 091147fd2d64
Step 3/3 : CMD [“dstat”, “-tcmndylp”, “–top-cpu”]
—> Running in 259ecfb143cc
Removing intermediate container 259ecfb143cc
—> c0c062513de9
Successfully built c0c062513de9
Successfully tagged lambzee/dstatmod:latest

 

===========================================================

-bash-4.2# docker run -d –name sysbenchcont -p 9200:9200 -p 9300:9300 -e “discovery.type=single-node” lambzee/syscpumem:latest
3aa3564855529e4e2369172bcab1abebcef68ab8fb3c62044c9f5d84ea1ae9b8
-bash-4.2#

-bash-4.2# docker container logs sysbenchcont
sysbench 1.0.16 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 50
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global

Initializing worker threads…

Threads started!

Total operations: 84279286 (8426154.22 per second)

82303.99 MiB transferred (8228.67 MiB/sec)
General statistics:
total time: 10.0004s
total number of events: 84279286

Latency (ms):
min: 0.00
avg: 0.01
max: 12.67
95th percentile: 0.01
sum: 476269.34

Threads fairness:
events (avg/stddev): 1685585.7200/153335.46
execution time (avg/stddev): 9.5254/0.05

-bash-4.2#

======================== Docker compose ========================

https://docs.docker.com/compose/install/

-bash: docker-compose: command not found
-bash-4.2# sudo curl -L “https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 617 0 617 0 0 1301 0 –:–:– –:–:– –:–:– 1304
100 11.2M 100 11.2M 0 0 873k 0 0:00:13 0:00:13 –:–:– 557k
-bash-4.2#

sudo chmod +x /usr/local/bin/docker-compose bash-4.2# docker-compose --version docker-compose version 1.23.2, build 1110ad01 -bash-4.2#

-bash-4.2# docker-compose up -d
Creating network “compose_my_net” with driver “bridge”
Creating compose_dstatmon_1 … done
Creating compose_mem_1 … done
Creating compose_cpu_1 … done
-bash-4.2#

-bash-4.2# more docker-compose.yml
version: “3”
services:
cpu:
image: lambzee/cpu:latest
depends_on:
– dstatmon
networks:
– my_net
mem:
image: lambzee/mem:latest
depends_on:
– dstatmon
networks:
– my_net

dstatmon:
image: lambzee/dstatmon:latest
networks:
– my_net

networks:
my_net:
driver: bridge

-bash-4.2#

-bash-4.2# docker network ls
NETWORK ID NAME DRIVER SCOPE
c70967cabb58 bridge bridge local
2a64a26e5fbf compose_my_net bridge local
14663c854d6b host host local
93fe31b80ab4 none null local
-bash-4.2#

bash-4.2# docker-compose down
Stopping compose_cpu_1 … done
Stopping compose_dstatmon_1 … done
Removing compose_cpu_1 … done
Removing compose_mem_1 … done
Removing compose_dstatmon_1 … done
Removing network compose_my_net
-bash-4.2#

 

-bash-4.2# docker system prune -a
WARNING! This will remove:
– all stopped containers
– all networks not used by at least one container
– all images without at least one container associated to them
– all build cache
Are you sure you want to continue? [y/N] y
Deleted Networks:
my_bridge_nt

Deleted Images:
untagged: 10.10.0.130:5000/cpu:latest
untagged: lambzee/cpu:latest
deleted: sha256:16f1187689039f15342a0c4d3ca05a02b46de2d8118a016059991bcbd3805a3b
untagged: lambzee/mem:latest
deleted: sha256:a0836afe0b89afd30ffd07799c6faef56bdb067dfec277d273be28a606268fd1
deleted: sha256:df88dbd115c75304cdd4ae0dc4d3bf143f6d945301fbd2a5df02fc5d8f026b02
deleted: sha256:a85b45691794a023d9efb6fbda1a0394b7039b2437848d5dbdb9196c0a214f3b
deleted: sha256:95313c457389656086c3972ef7ae846e009a31eab7dc1ea0ec18f5a8c92b6e87
deleted: sha256:672d46ea8d44714aae36bd55e5d2f61a00bda54069d9b981ad8cff5f71c2fe95
untagged: centos:latest
untagged: centos@sha256:184e5f35598e333bfa7de10d8fb1cebb5ee4df5bc0f970bf2b1e7c7345136426
deleted: sha256:1e1148e4cc2c148c6890a18e3b2d2dde41a6745ceb4e5fe94a923d811bf82ddb
deleted: sha256:071d8bd765171080d01682844524be57ac9883e53079b6ac66707e192ea25956
untagged: busybox:latest
untagged: busybox@sha256:061ca9704a714ee3e8b80523ec720c64f6209ad3f97c0ff7cb9ec7d19f15149f
deleted: sha256:d8233ab899d419c58cf3634c0df54ff5d8acc28f8173f09c21df4a07229e1205
deleted: sha256:adab5d09ba79ecf30d3a5af58394b23a447eda7ffffe16c500ddc5ccb4c0222f

Total reclaimed space: 363MB
-bash-4.2#

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s