/ HOWTO

Imágenes y recursos.


Luego de mucho tiempo utilizando Debian como S.O. diario, sea en todos los portátiles que uso, en los equipos servidores y de manera personal y laboral, me pude a investigar las medidas de los contenedores y los paquetes que traen.

Escuché muchas veces que hay que usar Alpine porque es una imágen realmente muy pequeña, de apenas unos megas, otras personas recomiendan Ubuntu, otros Centos… “cada maestro con su librito” cuenta el refrán.

Pienso que debemos utilizar la imágen que “mejor se acomode” a lo que queremos hacer, mas allá de preferencias, colores y gustos por ciertas distros, el sistema operativo base (imágen) que usaremos para un contenedor debe tener todo lo que necesitemos para el APP corriendo en ese contenedor.

De que me sirve un Alpine si luego no puedo hacer nada dentro del contenedor, debo usar Busybox (programa todo en uno) con bajo consumo de recursos pero limitado en sus funciones, donde además luego tendré que ir instalando otros paquetes, configurarlos hasta lograr lo que quiero?

Si pensamos que los contenedores pueden usar desde unos pocos megas hasta varios gigas (como en el caso del contenedor SQL Server que probamos). Pero que ese espacio es solamente “disco” y que estamos hablando de medidas muy pequeñas comparándolo con un equipo Virtual completo…

Descargas de cada Imgen, resúmen de espacios y paquetes.

# docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
c64513b74145: Pull complete 
01b8b12bad90: Pull complete 
c5d85cf7a05f: Pull complete 
b6b268720157: Pull complete 
e12192999ff1: Pull complete 
Digest: sha256:3f119dc0737f57f704ebecac8a6d8477b0f6ca1ca0332c7ee1395ed2c6a82be7
Status: Downloaded newer image for ubuntu:latest

# docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
8e3ba11ec2a2: Pull complete 
Digest: sha256:7043076348bf5040220df6ad703798fd8593a0918d06d3ce30c6c93be117e430
Status: Downloaded newer image for alpine:latest

# docker pull debian
Using default tag: latest
latest: Pulling from library/debian
55cbf04beb70: Pull complete 
Digest: sha256:f1f61086ea01a72b30c7287adee8c929e569853de03b7c462a8ac75e0d0224c4
Status: Downloaded newer image for debian:latest

# docker pull centos
Using default tag: latest
latest: Pulling from library/centos
256b176beaff: Pull complete 
Digest: sha256:6f6d986d425aeabdc3a02cb61c02abb2e78e57357e92417d6d58332856024faf
Status: Downloaded newer image for centos:latest

# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
be8881be8156: Pull complete 
32d9726baeef: Pull complete 
87e5e6f71297: Pull complete 
Digest: sha256:d85914d547a6c92faa39ce7058bd7529baacab7e0cd4255442b04577c4d1f424
Status: Downloaded newer image for nginx:latest

# docker pull mysql 
Using default tag: latest
latest: Pulling from library/mysql
be8881be8156: Already exists 
c3995dabd1d7: Pull complete 
9931fdda3586: Pull complete 
bb1b6b6eff6a: Pull complete 
a65f125fa718: Pull complete 
2d9f8dd09be2: Pull complete 
37b912cb2afe: Pull complete 
54242fcd8eaa: Pull complete 
0a9d4d211511: Pull complete 
270ae5bd02c2: Pull complete 
9b55b8e72e70: Pull complete 
68083f7985cd: Pull complete 
Digest: sha256:d39a8ab7679df309e7eff6ddba434ad5747cc2a2acee2d7c60d8221c9acedcad
Status: Downloaded newer image for mysql:latest

# docker pull oraclelinux
Using default tag: latest
latest: Pulling from library/oraclelinux
cd6653735b10: Pull complete 
Digest: sha256:e77a8cc18bf6593dca94f66dd7027a5a919a16e98a144d0e9a06cc5245bfd96b
Status: Downloaded newer image for oraclelinux:latest

# docker pull bitnami/minideb:latest
latest: Pulling from bitnami/minideb
6ffbf4daa883: Pull complete 
Digest: sha256:240187580c93c72b4120a0e4e94a61a54dfc1e48a445d34d016d56f15c6caf00
Status: Downloaded newer image for bitnami/minideb:latest

Todas las imágenes descargadas del repo oficial.

https://hub.docker.com/

Imágenes y medidas en disco.

# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
bitnami/minideb     latest              65f1ca5e4251        18 hours ago        53.7MB
mysql               latest              29e0ae3b69b9        19 hours ago        484MB
oraclelinux         latest              5bfa048e0f42        8 days ago          234MB
centos              latest              5182e96772bf        8 days ago          200MB
ubuntu              latest              735f80812f90        2 weeks ago         83.5MB
nginx               latest              c82521676580        3 weeks ago         109MB
debian              latest              3bbb526d2608        4 weeks ago         101MB
alpine              latest              11cd0b38bc3c        5 weeks ago         4.41MB

Desde 4 a 485 megas. Es poco? Mucho? depende de lo que contienen.

Como vimos en otros posts, el contenido de un contenedor está compuesto por partes que se van juntando para formar la imágen completa.

En mi equipo real, con todas las imágenes descargadas, tengo 1.3 gb usados.

1.3G	/var/lib/docker/overlay2/ 

En el caso del contenedor Debian, los paquetes instalados son.

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-============================================================
ii  adduser                     3.115              all                add and remove users and groups
ii  apt                         1.4.8              amd64              commandline package manager
ii  base-files                  9.9+deb9u5         amd64              Debian base system miscellaneous files
ii  base-passwd                 3.5.43             amd64              Debian base system master password and group files
ii  bash                        4.4-5              amd64              GNU Bourne Again SHell
ii  bsdutils                    1:2.29.2-1+deb9u1  amd64              basic utilities from 4.4BSD-Lite
ii  coreutils                   8.26-3             amd64              GNU core utilities
ii  dash                        0.5.8-2.4          amd64              POSIX-compliant shell
ii  debconf                     1.5.61             all                Debian configuration management system
ii  debian-archive-keyring      2017.5             all                GnuPG archive keys of the Debian archive
ii  debianutils                 4.8.1.1            amd64              Miscellaneous utilities specific to Debian
ii  diffutils                   1:3.5-3            amd64              File comparison utilities
ii  dpkg                        1.18.25            amd64              Debian package management system
ii  e2fslibs:amd64              1.43.4-2           amd64              ext2/ext3/ext4 file system libraries
ii  e2fsprogs                   1.43.4-2           amd64              ext2/ext3/ext4 file system utilities
ii  findutils                   4.6.0+git+20161106 amd64              utilities for finding files--find, xargs
ii  gcc-6-base:amd64            6.3.0-18+deb9u1    amd64              GCC, the GNU Compiler Collection (base package)
ii  gpgv                        2.1.18-8~deb9u2    amd64              GNU privacy guard - signature verification tool
ii  grep                        2.27-2             amd64              GNU grep, egrep and fgrep
ii  gzip                        1.6-5+b1           amd64              GNU compression utilities
ii  hostname                    3.18+b1            amd64              utility to set/show the host name or domain name
ii  init-system-helpers         1.48               all                helper tools for all init systems
ii  iproute2                    4.9.0-1+deb9u1     amd64              networking and traffic control tools
ii  iputils-ping                3:20161105-1       amd64              Tools to test the reachability of network hosts
ii  libacl1:amd64               2.2.52-3+b1        amd64              Access control list shared library
ii  libapt-pkg5.0:amd64         1.4.8              amd64              package management runtime library
ii  libattr1:amd64              1:2.4.47-2+b2      amd64              Extended attribute shared library
ii  libaudit-common             1:2.6.7-2          all                Dynamic library for security auditing - common files
ii  libaudit1:amd64             1:2.6.7-2          amd64              Dynamic library for security auditing
ii  libblkid1:amd64             2.29.2-1+deb9u1    amd64              block device ID library
ii  libbz2-1.0:amd64            1.0.6-8.1          amd64              high-quality block-sorting file compressor library - runtime
ii  libc-bin                    2.24-11+deb9u3     amd64              GNU C Library: Binaries
ii  libc6:amd64                 2.24-11+deb9u3     amd64              GNU C Library: Shared libraries
ii  libcap-ng0:amd64            0.7.7-3+b1         amd64              An alternate POSIX capabilities library
ii  libcap2:amd64               1:2.25-1           amd64              POSIX 1003.1e capabilities (library)
ii  libcomerr2:amd64            1.43.4-2           amd64              common error description library
ii  libdb5.3:amd64              5.3.28-12+deb9u1   amd64              Berkeley v5.3 Database Libraries [runtime]
ii  libdebconfclient0:amd64     0.227              amd64              Debian Configuration Management System (C-implementation lib
ii  libelf1:amd64               0.168-1            amd64              library to read and write ELF files
ii  libfdisk1:amd64             2.29.2-1+deb9u1    amd64              fdisk partitioning library
ii  libgcc1:amd64               1:6.3.0-18+deb9u1  amd64              GCC support library
ii  libgcrypt20:amd64           1.7.6-2+deb9u3     amd64              LGPL Crypto library - runtime library
ii  libgpg-error0:amd64         1.26-2             amd64              library for common error values and messages in GnuPG compon
ii  libidn11:amd64              1.33-1             amd64              GNU Libidn library, implementation of IETF IDN specification
ii  liblz4-1:amd64              0.0~r131-2+b1      amd64              Fast LZ compression algorithm library - runtime
ii  liblzma5:amd64              5.2.2-1.2+b1       amd64              XZ-format compression library
ii  libmnl0:amd64               1.0.4-2            amd64              minimalistic Netlink communication library
ii  libmount1:amd64             2.29.2-1+deb9u1    amd64              device mounting library
ii  libncursesw5:amd64          6.0+20161126-1+deb amd64              shared libraries for terminal handling (wide character suppo
ii  libnettle6:amd64            3.3-1+b2           amd64              low level cryptographic library (symmetric and one-way crypt
ii  libpam-modules:amd64        1.1.8-3.6          amd64              Pluggable Authentication Modules for PAM
ii  libpam-modules-bin          1.1.8-3.6          amd64              Pluggable Authentication Modules for PAM - helper binaries
ii  libpam-runtime              1.1.8-3.6          all                Runtime support for the PAM library
ii  libpam0g:amd64              1.1.8-3.6          amd64              Pluggable Authentication Modules library
ii  libpcre3:amd64              2:8.39-3           amd64              Old Perl 5 Compatible Regular Expression Library - runtime f
ii  libselinux1:amd64           2.6-3+b3           amd64              SELinux runtime shared libraries
ii  libsemanage-common          2.6-2              all                Common files for SELinux policy management libraries
ii  libsemanage1:amd64          2.6-2              amd64              SELinux policy management library
ii  libsepol1:amd64             2.6-2              amd64              SELinux library for manipulating binary security policies
ii  libsmartcols1:amd64         2.29.2-1+deb9u1    amd64              smart column output alignment library
ii  libss2:amd64                1.43.4-2           amd64              command-line interface parsing library
ii  libstdc++6:amd64            6.3.0-18+deb9u1    amd64              GNU Standard C++ Library v3
ii  libsystemd0:amd64           232-25+deb9u4      amd64              systemd utility library
ii  libtinfo5:amd64             6.0+20161126-1+deb amd64              shared low-level terminfo library for terminal handling
ii  libudev1:amd64              232-25+deb9u4      amd64              libudev shared library
ii  libustr-1.0-1:amd64         1.0.4-6            amd64              Micro string library: shared library
ii  libuuid1:amd64              2.29.2-1+deb9u1    amd64              Universally Unique ID library
ii  login                       1:4.4-4.1          amd64              system login tools
ii  lsb-base                    9.20161125         all                Linux Standard Base init script functionality
ii  mawk                        1.3.3-17+b3        amd64              a pattern scanning and text processing language
ii  mount                       2.29.2-1+deb9u1    amd64              tools for mounting and manipulating filesystems
ii  multiarch-support           2.24-11+deb9u3     amd64              Transitional package to ensure multiarch compatibility
ii  ncurses-base                6.0+20161126-1+deb all                basic terminal type definitions
ii  ncurses-bin                 6.0+20161126-1+deb amd64              terminal-related programs and man pages
ii  passwd                      1:4.4-4.1          amd64              change and administer password and group data
ii  perl-base                   5.24.1-3+deb9u4    amd64              minimal Perl system
ii  sed                         4.4-1              amd64              GNU stream editor for filtering/transforming text
ii  sensible-utils              0.0.9+deb9u1       all                Utilities for sensible alternative selection
ii  sysvinit-utils              2.88dsf-59.9       amd64              System-V-like utilities
ii  tar                         1.29b-1.1          amd64              GNU version of the tar archiving utility
ii  tzdata                      2018e-0+deb9u1     all                time zone and daylight-saving time data
ii  util-linux                  2.29.2-1+deb9u1    amd64              miscellaneous system utilities
ii  zlib1g:amd64                1:1.2.8.dfsg-5     amd64              compression library - runtime

Para el contenedor Centos.

# yum list installed
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: mirror.airenetworks.es
 * extras: mirror.airenetworks.es
 * updates: mirror.airenetworks.es
Installed Packages
acl.x86_64                                                           2.2.51-14.el7                                            @CentOS 
audit-libs.x86_64                                                    2.8.1-3.el7                                              @CentOS 
basesystem.noarch                                                    10.0-7.el7.centos                                        @CentOS 
bash.x86_64                                                          4.2.46-30.el7                                            @CentOS 
bind-license.noarch                                                  32:9.9.4-61.el7                                          @CentOS 
binutils.x86_64                                                      2.27-28.base.el7_5.1                                     @Updates
bzip2-libs.x86_64                                                    1.0.6-13.el7                                             @CentOS 
ca-certificates.noarch                                               2018.2.22-70.0.el7_5                                     @Updates
centos-release.x86_64                                                7-5.1804.1.el7.centos                                    @Updates
chkconfig.x86_64                                                     1.7.4-1.el7                                              @CentOS 
coreutils.x86_64                                                     8.22-21.el7                                              @CentOS 
cpio.x86_64                                                          2.11-27.el7                                              @CentOS 
cracklib.x86_64                                                      2.9.0-11.el7                                             @CentOS 
cracklib-dicts.x86_64                                                2.9.0-11.el7                                             @CentOS 
cryptsetup-libs.x86_64                                               1.7.4-4.el7                                              @CentOS 
curl.x86_64                                                          7.29.0-46.el7                                            @CentOS 
cyrus-sasl-lib.x86_64                                                2.1.26-23.el7                                            @CentOS 
dbus.x86_64                                                          1:1.10.24-7.el7                                          @CentOS 
dbus-glib.x86_64                                                     0.100-7.el7                                              @CentOS 
dbus-libs.x86_64                                                     1:1.10.24-7.el7                                          @CentOS 
dbus-python.x86_64                                                   1.1.1-9.el7                                              @CentOS 
device-mapper.x86_64                                                 7:1.02.146-4.el7                                         @CentOS 
device-mapper-libs.x86_64                                            7:1.02.146-4.el7                                         @CentOS 
diffutils.x86_64                                                     3.3-4.el7                                                @CentOS 
dracut.x86_64                                                        033-535.el7                                              @CentOS 
elfutils-default-yama-scope.noarch                                   0.170-4.el7                                              @CentOS 
elfutils-libelf.x86_64                                               0.170-4.el7                                              @CentOS 
elfutils-libs.x86_64                                                 0.170-4.el7                                              @CentOS 
expat.x86_64                                                         2.1.0-10.el7_3                                           @CentOS 
file-libs.x86_64                                                     5.11-33.el7                                              @CentOS 
filesystem.x86_64                                                    3.2-25.el7                                               @CentOS 
findutils.x86_64                                                     1:4.5.11-5.el7                                           @CentOS 
gawk.x86_64                                                          4.0.2-4.el7_3.1                                          @CentOS 
gdbm.x86_64                                                          1.10-8.el7                                               @CentOS 
glib2.x86_64                                                         2.54.2-2.el7                                             @CentOS 
glibc.x86_64                                                         2.17-222.el7                                             @CentOS 
glibc-common.x86_64                                                  2.17-222.el7                                             @CentOS 
gmp.x86_64                                                           1:6.0.0-15.el7                                           @CentOS 
gnupg2.x86_64                                                        2.0.22-5.el7_5                                           @Updates
gobject-introspection.x86_64                                         1.50.0-1.el7                                             @CentOS 
gpgme.x86_64                                                         1.3.2-5.el7                                              @CentOS 
grep.x86_64                                                          2.20-3.el7                                               @CentOS 
gzip.x86_64                                                          1.5-10.el7                                               @CentOS 
hardlink.x86_64                                                      1:1.0-19.el7                                             @CentOS 
hostname.x86_64                                                      3.13-3.el7                                               @CentOS 
info.x86_64                                                          5.1-5.el7                                                @CentOS 
iputils.x86_64                                                       20160308-10.el7                                          @CentOS 
keyutils-libs.x86_64                                                 1.5.8-3.el7                                              @CentOS 
kmod.x86_64                                                          20-21.el7                                                @CentOS 
kmod-libs.x86_64                                                     20-21.el7                                                @CentOS 
kpartx.x86_64                                                        0.4.9-119.el7                                            @CentOS 
krb5-libs.x86_64                                                     1.15.1-19.el7                                            @Updates
libacl.x86_64                                                        2.2.51-14.el7                                            @CentOS 
libassuan.x86_64                                                     2.1.0-3.el7                                              @CentOS 
libattr.x86_64                                                       2.4.46-13.el7                                            @CentOS 
libblkid.x86_64                                                      2.23.2-52.el7                                            @CentOS 
libcap.x86_64                                                        2.22-9.el7                                               @CentOS 
libcap-ng.x86_64                                                     0.7.5-4.el7                                              @CentOS 
libcom_err.x86_64                                                    1.42.9-12.el7_5                                          @Updates
libcurl.x86_64                                                       7.29.0-46.el7                                            @CentOS 
libdb.x86_64                                                         5.3.21-24.el7                                            @CentOS 
libdb-utils.x86_64                                                   5.3.21-24.el7                                            @CentOS 
libffi.x86_64                                                        3.0.13-18.el7                                            @CentOS 
libgcc.x86_64                                                        4.8.5-28.el7_5.1                                         @Updates
libgcrypt.x86_64                                                     1.5.3-14.el7                                             @CentOS 
libgpg-error.x86_64                                                  1.12-3.el7                                               @CentOS 
libidn.x86_64                                                        1.28-4.el7                                               @CentOS 
libmount.x86_64                                                      2.23.2-52.el7                                            @CentOS 
libpwquality.x86_64                                                  1.2.3-5.el7                                              @CentOS 
libselinux.x86_64                                                    2.5-12.el7                                               @CentOS 
libsemanage.x86_64                                                   2.5-11.el7                                               @CentOS 
libsepol.x86_64                                                      2.5-8.1.el7                                              @CentOS 
libssh2.x86_64                                                       1.4.3-10.el7_2.1                                         @CentOS 
libstdc++.x86_64                                                     4.8.5-28.el7_5.1                                         @Updates
libtasn1.x86_64                                                      4.10-1.el7                                               @CentOS 
libuser.x86_64                                                       0.60-9.el7                                               @CentOS 
libutempter.x86_64                                                   1.1.6-4.el7                                              @CentOS 
libuuid.x86_64                                                       2.23.2-52.el7                                            @CentOS 
libverto.x86_64                                                      0.2.5-4.el7                                              @CentOS 
libxml2.x86_64                                                       2.9.1-6.el7_2.3                                          @CentOS 
libxml2-python.x86_64                                                2.9.1-6.el7_2.3                                          @CentOS 
lua.x86_64                                                           5.1.4-15.el7                                             @CentOS 
lz4.x86_64                                                           1.7.5-2.el7                                              @CentOS 
ncurses.x86_64                                                       5.9-14.20130511.el7_4                                    @CentOS 
ncurses-base.noarch                                                  5.9-14.20130511.el7_4                                    @CentOS 
ncurses-libs.x86_64                                                  5.9-14.20130511.el7_4                                    @CentOS 
nspr.x86_64                                                          4.19.0-1.el7_5                                           @Updates
nss.x86_64                                                           3.36.0-5.el7_5                                           @Updates
nss-pem.x86_64                                                       1.0.3-4.el7                                              @CentOS 
nss-softokn.x86_64                                                   3.36.0-5.el7_5                                           @Updates
nss-softokn-freebl.x86_64                                            3.36.0-5.el7_5                                           @Updates
nss-sysinit.x86_64                                                   3.36.0-5.el7_5                                           @Updates
nss-tools.x86_64                                                     3.36.0-5.el7_5                                           @Updates
nss-util.x86_64                                                      3.36.0-1.el7_5                                           @Updates
openldap.x86_64                                                      2.4.44-15.el7_5                                          @Updates
openssl-libs.x86_64                                                  1:1.0.2k-12.el7                                          @CentOS 
p11-kit.x86_64                                                       0.23.5-3.el7                                             @CentOS 
p11-kit-trust.x86_64                                                 0.23.5-3.el7                                             @CentOS 
pam.x86_64                                                           1.1.8-22.el7                                             @CentOS 
passwd.x86_64                                                        0.79-4.el7                                               @CentOS 
pcre.x86_64                                                          8.32-17.el7                                              @CentOS 
pinentry.x86_64                                                      0.8.1-17.el7                                             @CentOS 
pkgconfig.x86_64                                                     1:0.27.1-4.el7                                           @CentOS 
popt.x86_64                                                          1.13-16.el7                                              @CentOS 
procps-ng.x86_64                                                     3.3.10-17.el7_5.2                                        @Updates
pth.x86_64                                                           2.0.7-23.el7                                             @CentOS 
pygpgme.x86_64                                                       0.3-9.el7                                                @CentOS 
pyliblzma.x86_64                                                     0.5.3-11.el7                                             @CentOS 
python.x86_64                                                        2.7.5-69.el7_5                                           @Updates
python-chardet.noarch                                                2.2.1-1.el7_1                                            @CentOS 
python-gobject-base.x86_64                                           3.22.0-1.el7_4.1                                         @CentOS 
python-iniparse.noarch                                               0.4-9.el7                                                @CentOS 
python-kitchen.noarch                                                1.1.1-5.el7                                              @CentOS 
python-libs.x86_64                                                   2.7.5-69.el7_5                                           @Updates
python-pycurl.x86_64                                                 7.19.0-19.el7                                            @CentOS 
python-urlgrabber.noarch                                             3.10-8.el7                                               @CentOS 
pyxattr.x86_64                                                       0.5.1-5.el7                                              @CentOS 
qrencode-libs.x86_64                                                 3.4.1-3.el7                                              @CentOS 
readline.x86_64                                                      6.2-10.el7                                               @CentOS 
rootfiles.noarch                                                     8.1-11.el7                                               @CentOS 
rpm.x86_64                                                           4.11.3-32.el7                                            @CentOS 
rpm-build-libs.x86_64                                                4.11.3-32.el7                                            @CentOS 
rpm-libs.x86_64                                                      4.11.3-32.el7                                            @CentOS 
rpm-python.x86_64                                                    4.11.3-32.el7                                            @CentOS 
sed.x86_64                                                           4.2.2-5.el7                                              @CentOS 
setup.noarch                                                         2.8.71-9.el7                                             @CentOS 
shadow-utils.x86_64                                                  2:4.1.5.1-24.el7                                         @CentOS 
shared-mime-info.x86_64                                              1.8-4.el7                                                @CentOS 
sqlite.x86_64                                                        3.7.17-8.el7                                             @CentOS 
systemd.x86_64                                                       219-57.el7                                               @CentOS 
systemd-libs.x86_64                                                  219-57.el7                                               @CentOS 
tar.x86_64                                                           2:1.26-34.el7                                            @CentOS 
tzdata.noarch                                                        2018e-3.el7                                              @Updates
ustr.x86_64                                                          1.0.4-16.el7                                             @CentOS 
util-linux.x86_64                                                    2.23.2-52.el7                                            @CentOS 
vim-minimal.x86_64                                                   2:7.4.160-4.el7                                          @CentOS 
xz.x86_64                                                            5.2.2-1.el7                                              @CentOS 
xz-libs.x86_64                                                       5.2.2-1.el7                                              @CentOS 
yum.noarch                                                           3.4.3-158.el7.centos                                     @CentOS 
yum-metadata-parser.x86_64                                           1.1.4-10.el7                                             @CentOS 
yum-plugin-fastestmirror.noarch                                      1.1.31-46.el7_5                                          @Updates
yum-plugin-ovl.noarch                                                1.1.31-46.el7_5                                          @Updates
yum-utils.noarch                                                     1.1.31-46.el7_5                                          @Updates
zlib.x86_64                                                          1.2.7-17.el7                                             @CentOS

Para el contenedor con MySQL.

# dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-============================================================
ii  adduser                     3.115              all                add and remove users and groups
ii  apt                         1.4.8              amd64              commandline package manager
ii  base-files                  9.9+deb9u5         amd64              Debian base system miscellaneous files
ii  base-passwd                 3.5.43             amd64              Debian base system master password and group files
ii  bash                        4.4-5              amd64              GNU Bourne Again SHell
ii  bsdutils                    1:2.29.2-1+deb9u1  amd64              basic utilities from 4.4BSD-Lite
ii  coreutils                   8.26-3             amd64              GNU core utilities
ii  dash                        0.5.8-2.4          amd64              POSIX-compliant shell
ii  debconf                     1.5.61             all                Debian configuration management system
ii  debian-archive-keyring      2017.5             all                GnuPG archive keys of the Debian archive
ii  debianutils                 4.8.1.1            amd64              Miscellaneous utilities specific to Debian
ii  diffutils                   1:3.5-3            amd64              File comparison utilities
ii  dirmngr                     2.1.18-8~deb9u2    amd64              GNU privacy guard - network certificate management service
ii  dpkg                        1.18.25            amd64              Debian package management system
ii  e2fslibs:amd64              1.43.4-2           amd64              ext2/ext3/ext4 file system libraries
ii  e2fsprogs                   1.43.4-2           amd64              ext2/ext3/ext4 file system utilities
ii  findutils                   4.6.0+git+20161106 amd64              utilities for finding files--find, xargs
ii  gcc-6-base:amd64            6.3.0-18+deb9u1    amd64              GCC, the GNU Compiler Collection (base package)
ii  gnupg                       2.1.18-8~deb9u2    amd64              GNU privacy guard - a free PGP replacement
ii  gnupg-agent                 2.1.18-8~deb9u2    amd64              GNU privacy guard - cryptographic agent
ii  gpgv                        2.1.18-8~deb9u2    amd64              GNU privacy guard - signature verification tool
ii  grep                        2.27-2             amd64              GNU grep, egrep and fgrep
ii  gzip                        1.6-5+b1           amd64              GNU compression utilities
ii  hostname                    3.18+b1            amd64              utility to set/show the host name or domain name
ii  init-system-helpers         1.48               all                helper tools for all init systems
ii  libacl1:amd64               2.2.52-3+b1        amd64              Access control list shared library
ii  libaio1:amd64               0.3.110-3          amd64              Linux kernel AIO access library - shared library
ii  libapt-pkg5.0:amd64         1.4.8              amd64              package management runtime library
ii  libassuan0:amd64            2.4.3-2            amd64              IPC library for the GnuPG components
ii  libattr1:amd64              1:2.4.47-2+b2      amd64              Extended attribute shared library
ii  libaudit-common             1:2.6.7-2          all                Dynamic library for security auditing - common files
ii  libaudit1:amd64             1:2.6.7-2          amd64              Dynamic library for security auditing
ii  libblkid1:amd64             2.29.2-1+deb9u1    amd64              block device ID library
ii  libbz2-1.0:amd64            1.0.6-8.1          amd64              high-quality block-sorting file compressor library - runtime
ii  libc-bin                    2.24-11+deb9u3     amd64              GNU C Library: Binaries
ii  libc6:amd64                 2.24-11+deb9u3     amd64              GNU C Library: Shared libraries
ii  libcap-ng0:amd64            0.7.7-3+b1         amd64              An alternate POSIX capabilities library
ii  libcomerr2:amd64            1.43.4-2           amd64              common error description library
ii  libdb5.3:amd64              5.3.28-12+deb9u1   amd64              Berkeley v5.3 Database Libraries [runtime]
ii  libdebconfclient0:amd64     0.227              amd64              Debian Configuration Management System (C-implementation lib
ii  libfdisk1:amd64             2.29.2-1+deb9u1    amd64              fdisk partitioning library
ii  libffi6:amd64               3.2.1-6            amd64              Foreign Function Interface library runtime
ii  libgcc1:amd64               1:6.3.0-18+deb9u1  amd64              GCC support library
ii  libgcrypt20:amd64           1.7.6-2+deb9u3     amd64              LGPL Crypto library - runtime library
ii  libgdbm3:amd64              1.8.3-14           amd64              GNU dbm database routines (runtime version)
ii  libgmp10:amd64              2:6.1.2+dfsg-1     amd64              Multiprecision arithmetic library
ii  libgnutls30:amd64           3.5.8-5+deb9u3     amd64              GNU TLS library - main runtime library
ii  libgpg-error0:amd64         1.26-2             amd64              library for common error values and messages in GnuPG compon
ii  libgpm2:amd64               1.20.4-6.2+b1      amd64              General Purpose Mouse - shared library
ii  libhogweed4:amd64           3.3-1+b2           amd64              low level cryptographic library (public-key cryptos)
ii  libidn11:amd64              1.33-1             amd64              GNU Libidn library, implementation of IETF IDN specification
ii  libksba8:amd64              1.3.5-2            amd64              X.509 and CMS support library
ii  libldap-2.4-2:amd64         2.4.44+dfsg-5+deb9 amd64              OpenLDAP libraries
ii  libldap-common              2.4.44+dfsg-5+deb9 all                OpenLDAP common files for libraries
ii  liblz4-1:amd64              0.0~r131-2+b1      amd64              Fast LZ compression algorithm library - runtime
ii  liblzma5:amd64              5.2.2-1.2+b1       amd64              XZ-format compression library
ii  libmecab2:amd64             0.996-3.1          amd64              Libraries of Mecab
ii  libmount1:amd64             2.29.2-1+deb9u1    amd64              device mounting library
ii  libncurses5:amd64           6.0+20161126-1+deb amd64              shared libraries for terminal handling
ii  libncursesw5:amd64          6.0+20161126-1+deb amd64              shared libraries for terminal handling (wide character suppo
ii  libnettle6:amd64            3.3-1+b2           amd64              low level cryptographic library (symmetric and one-way crypt
ii  libnpth0:amd64              1.3-1              amd64              replacement for GNU Pth using system threads
ii  libnuma1:amd64              2.0.11-2.1         amd64              Libraries for controlling NUMA policy
ii  libp11-kit0:amd64           0.23.3-2           amd64              library for loading and coordinating access to PKCS#11 modul
ii  libpam-modules:amd64        1.1.8-3.6          amd64              Pluggable Authentication Modules for PAM
ii  libpam-modules-bin          1.1.8-3.6          amd64              Pluggable Authentication Modules for PAM - helper binaries
ii  libpam-runtime              1.1.8-3.6          all                Runtime support for the PAM library
ii  libpam0g:amd64              1.1.8-3.6          amd64              Pluggable Authentication Modules library
ii  libpcre3:amd64              2:8.39-3           amd64              Old Perl 5 Compatible Regular Expression Library - runtime f
ii  libperl5.24:amd64           5.24.1-3+deb9u4    amd64              shared Perl library
ii  libreadline7:amd64          7.0-3              amd64              GNU readline and history libraries, run-time libraries
ii  libsasl2-2:amd64            2.1.27~101-g078060 amd64              Cyrus SASL - authentication abstraction library
ii  libsasl2-modules-db:amd64   2.1.27~101-g078060 amd64              Cyrus SASL - pluggable authentication modules (DB)
ii  libselinux1:amd64           2.6-3+b3           amd64              SELinux runtime shared libraries
ii  libsemanage-common          2.6-2              all                Common files for SELinux policy management libraries
ii  libsemanage1:amd64          2.6-2              amd64              SELinux policy management library
ii  libsepol1:amd64             2.6-2              amd64              SELinux library for manipulating binary security policies
ii  libsmartcols1:amd64         2.29.2-1+deb9u1    amd64              smart column output alignment library
ii  libsqlite3-0:amd64          3.16.2-5+deb9u1    amd64              SQLite 3 shared library
ii  libss2:amd64                1.43.4-2           amd64              command-line interface parsing library
ii  libssl1.1:amd64             1.1.0f-3+deb9u2    amd64              Secure Sockets Layer toolkit - shared libraries
ii  libstdc++6:amd64            6.3.0-18+deb9u1    amd64              GNU Standard C++ Library v3
ii  libsystemd0:amd64           232-25+deb9u4      amd64              systemd utility library
ii  libtasn1-6:amd64            4.10-1.1+deb9u1    amd64              Manage ASN.1 structures (runtime)
ii  libtinfo5:amd64             6.0+20161126-1+deb amd64              shared low-level terminfo library for terminal handling
ii  libudev1:amd64              232-25+deb9u4      amd64              libudev shared library
ii  libustr-1.0-1:amd64         1.0.4-6            amd64              Micro string library: shared library
ii  libuuid1:amd64              2.29.2-1+deb9u1    amd64              Universally Unique ID library
ii  login                       1:4.4-4.1          amd64              system login tools
ii  lsb-base                    9.20161125         all                Linux Standard Base init script functionality
ii  mawk                        1.3.3-17+b3        amd64              a pattern scanning and text processing language
ii  mecab-ipadic                2.7.0-20070801+mai all                IPA dictionary compiled for Mecab
ii  mecab-ipadic-utf8           2.7.0-20070801+mai all                IPA dictionary encoded in UTF-8 compiled for Mecab
ii  mecab-utils                 0.996-3.1          amd64              Support programs of Mecab
ii  mount                       2.29.2-1+deb9u1    amd64              tools for mounting and manipulating filesystems
ii  multiarch-support           2.24-11+deb9u3     amd64              Transitional package to ensure multiarch compatibility
ii  mysql-common                8.0.12-1debian9    amd64              MySQL Common
ii  mysql-community-client      8.0.12-1debian9    amd64              MySQL Client
ii  mysql-community-client-core 8.0.12-1debian9    amd64              MySQL Client Core Binaries
ii  mysql-community-server-core 8.0.12-1debian9    amd64              MySQL Server Core Binaires
ii  ncurses-base                6.0+20161126-1+deb all                basic terminal type definitions
ii  ncurses-bin                 6.0+20161126-1+deb amd64              terminal-related programs and man pages
ii  openssl                     1.1.0f-3+deb9u2    amd64              Secure Sockets Layer toolkit - cryptographic utility
ii  passwd                      1:4.4-4.1          amd64              change and administer password and group data
ii  perl                        5.24.1-3+deb9u4    amd64              Larry Wall's Practical Extraction and Report Language
ii  perl-base                   5.24.1-3+deb9u4    amd64              minimal Perl system
ii  perl-modules-5.24           5.24.1-3+deb9u4    all                Core Perl modules
ii  pinentry-curses             1.0.0-2            amd64              curses-based PIN or pass-phrase entry dialog for GnuPG
ii  pwgen                       2.07-1.1+b1        amd64              Automatic Password generation
ii  readline-common             7.0-3              all                GNU readline and history libraries, common files
ii  sed                         4.4-1              amd64              GNU stream editor for filtering/transforming text
ii  sensible-utils              0.0.9+deb9u1       all                Utilities for sensible alternative selection
ii  sysvinit-utils              2.88dsf-59.9       amd64              System-V-like utilities
ii  tar                         1.29b-1.1          amd64              GNU version of the tar archiving utility
ii  tzdata                      2018e-0+deb9u1     all                time zone and daylight-saving time data
ii  util-linux                  2.29.2-1+deb9u1    amd64              miscellaneous system utilities
ii  zlib1g:amd64                1:1.2.8.dfsg-5     amd64              compression library - runtime

En el caso de Busybox, contiene “busybox” y poco mas.

/ # busybox 
BusyBox v1.28.4 (2018-05-30 10:45:57 UTC) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Según la distro utilizada, el comando para ver los paquetes instalados es distinto. (yum, pacman, apt).

Según sean nuestras necesidades de productos para tneer instalados en un contenedor podemos usar una distro o otra, y por supuesto, también podemos agregarlos a mano luego.

Otros puntos importantes, si descargamos varias imágenes que estén basadas sobre otras imágenes, como ejemplo, bajamos Debian 9 y además, otra imágen basada en Debian 9 con mas paquetes agregados, el espacio ocupado en nuestro disco real no será el doble, porque compartirán una imágen base igual.

Un caso para verificar es BusyBox y MySQL, ambas imágenes usan esta base.

be8881be8156

Esto se ve claramente al descargar una imágen, aparecen varias líneas con medidas distintas.

Por otro lado, si vamos a montar muchos contenedores en el mismo equipo real, es mejor que todos ellos tengan la misma imágen base, para ahorrar espacio en cada una, ya que todas compartirán una gran parte central (misma imágen base).

Recordemos que todos los contenedores están corriendo sobre el Kernel de mi equipo real.

 # uname -a
Linux c8620b896e2d 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u1 (2018-08-03) x86_64 GNU/Linux

Subscríbete y recibirás los últimos artículos semanalmente en tu email.