CLI App Testing

Assignment

  • Use different Linux distro containers to check curl cli tool version
  • Use two different terminal windows to start bash in both centos:7 and ubuntu:14.04, using -it
  • Learn the docker container --rm option so you can save cleanup
  • Ensure curl is installed and on latest version for that distro
    • ubuntu: apt-get update && apt-get install curl
    • centos: yum update curl
  • Check curl --version

Solution

Open first terminal

~> docker container run --rm -it centos:7 bash

[root@487e7466947e /]~> yum update curl
    ...

[root@487e7466947e /]~> curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.28.4 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp

Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets

Open second terminal

~> docker container run --rm -it ubuntu:14.04 bash

root@8c079141f1de:/~> apt-get update && apt-get install -y curl
    ...

root@8c079141f1de:/~> curl --version
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP

--rm option removed containers automatically after we've exited them

~> docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS         NAMES

results matching ""

    No results matching ""