20533 -From nano servers now to containers…

finance background

We continue the Azure 20533 Exam tips, and today i wish to explain in my own words this stuff called containers, by the way it’s the new mutation of the virtualization as we known it.

when we worked in Windows Server virtualization with Hyper-V, what we share from the operating system is the Access to physical resources. but each VM gets an generic driver for the Network Card, and every other resource as it. When we saw the container option, the hyper-visor shares the entire operating system, and the container has the libraries it needs to run. In Azure we can now run containers and this is what i’ve done…

Requesting a Cloud Shell.Succeeded.
Connecting terminal…

Welcome to Azure Cloud Shell

Type «az» to use Azure CLI 2.0
Type «help» to learn about Cloud Shell

fabian@Azure:~$ az interactive

Do you agree to sending telemetry (yes/no)? Default answer is yes: yes

fabian@Azure:~$ FQDN=$(az vm show –resource-group 20533E0701-LabRG –name 20533E0701-vm0 –show-details –query [fqdns] –output tsv)
fabian@Azure:~$ echo $FQDN
l0720533ecih5umvouc6hy.eastus.cloudapp.azure.com
fabian@Azure:~$ ssh student@$FQDN
The authenticity of host ‘l0720533ecih5umvouc6hy.eastus.cloudapp.azure.com (104.41.128.203)’ can’t be established.
ECDSA key fingerprint is SHA256:Ou9LQt4p7hctFzaaDnorVv9IFhwSHp0iTBfGyAD9xnA.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘l0720533ecih5umvouc6hy.eastus.cloudapp.azure.com,104.41.128.203’ (ECDSA) to the list of known hosts.
student@l0720533ecih5umvouc6hy.eastus.cloudapp.azure.com‘s password:
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.13.0-1018-azure x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud

51 packages can be updated.
37 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user «root»), use «sudo <command>».
See «man sudo_root» for details.

student@20533E0701-vm0:~$ docker run -d -p 80:80 –restart=always nginx
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See ‘docker run –help’.
student@20533E0701-vm0:~$ sudo -i
root@20533E0701-vm0:~# apt-cache search docker
libcib-dev – cluster resource manager CIB library development
libcib4 – cluster resource manager CIB library
libcrmcluster-dev – cluster resource manager cluster library development
libcrmcluster4 – cluster resource manager cluster library
libcrmcommon-dev – cluster resource manager common library development
libcrmcommon3 – cluster resource manager common library
libcrmservice-dev – cluster resource manager service library development
libcrmservice3 – cluster resource manager service library
liblrmd-dev – cluster resource manager LRMD library development
liblrmd1 – cluster resource manager LRMD library
libpe-rules2 – cluster resource manager Policy Engine rules library
libpe-status10 – cluster resource manager Policy Engine status library
libpengine-dev – cluster resource manager Policy Engine library development
libpengine10 – cluster resource manager Policy Engine library
libstonithd-dev – cluster resource manager STONITH daemon library development
libstonithd2 – cluster resource manager STONITH daemon library
libtransitioner2 – cluster resource manager transitioner library
pacemaker – cluster resource manager
pacemaker-cli-utils – cluster resource manager command line utilities
pacemaker-common – cluster resource manager common files
pacemaker-doc – cluster resource manager HTML documentation
pacemaker-resource-agents – cluster resource manager general resource agents
python-magnumclient – client library for Magnum API – Python 2.x
python-magnumclient-doc – client library for Magnum API – doc
cadvisor – analyze resource usage and performance characteristics of running containers
ctop – Command line / text based Linux Containers monitoring tool
debocker – docker-powered package builder for Debian
debootstick – Turn a chroot environment into a bootable image
docker – System tray for KDE3/GNOME2 docklet applications
docker-compose – Punctual, lightweight development environments using Docker
docker-registry – Docker toolset to pack, ship, store, and deliver content
docker.io – Linux container runtime
golang-docker-dev – Transitional package for golang-github-docker-docker-dev
golang-github-docker-distribution-dev – Docker toolset to pack, ship, store, and deliver content (source)
golang-github-docker-docker-dev – Externally reusable Go packages included with Docker
golang-github-docker-go-units-dev – parse and print size and time units in human-readable format
golang-github-docker-libkv-dev – Key/Value store abstraction library
golang-github-docker-libtrust-dev – Primitives for identity and authorization
golang-github-docker-notary-dev – tool for running and interacting with trusted collections
golang-github-docker-spdystream-dev – multiplexed stream library using spdy
golang-github-endophage-gotuf-dev – Go implementation of the TUF specification
golang-github-fsouza-go-dockerclient-dev – Docker client library in Go
golang-github-google-cadvisor-dev – analyze resource usage and performance of running containers
golang-github-opencontainers-runc-dev – Open Container Project – develpoment files
golang-github-samalba-dockerclient-dev – Docker client library in Go
golang-github-vishvananda-netlink-dev – netlink library for go
gosu – Simple Go-based setuid+setgid+setgroups+exec
karbon – vector graphics application for the Calligra Suite
kdocker – lets you dock any application into the system tray
libnss-docker – nss module for finding Docker containers
magnum-api – OpenStack containers as a service
magnum-common – OpenStack containers as a service – API server
magnum-conductor – OpenStack containers as a service – conductor
needrestart – check which daemons need to be restarted after library upgrades
ovn-docker – OVN Docker drivers
pacemaker-remote – cluster resource manager proxy daemon for remote nodes
pidgin – graphical multi-protocol instant messaging client for X
python-dockerpty – Pseudo-tty handler for docker Python client (Python 2.x)
python-magnum – OpenStack containers as a service – Python library
python3-dockerpty – Pseudo-tty handler for docker Python client (Python 3.x)
python3-magnumclient – client library for Magnum API – Python 3.x
rawdns – raw DNS interface to the Docker API
ruby-docker-api – Ruby gem to interact with docker.io remote API
sen – Terminal user interface for docker engine
systemd-docker – wrapper for «docker run» to handle systemd quirks
vim-syntax-docker – Docker container engine – Vim highlighting syntax files
docker-doc – Linux container runtime — documentation
golang-github-docker-containerd-dev – runC develpoment files
python-docker – Python wrapper to access docker.io’s control socket
python3-docker – Python 3 wrapper to access docker.io’s control socket
cockpit-docker – Cockpit user interface for Docker containers
docker-ce – Docker: the open-source application container engine
root@20533E0701-vm0:~# cd /
root@20533E0701-vm0:/# cd /etc/
root@20533E0701-vm0:/etc# ls
acpi dbus-1 init logrotate.d overlayroot.local.conf request-key.conf sudoers.d
adduser.conf debconf.conf init.d lsb-release pam.conf request-key.d sysctl.conf
alternatives debian_version initramfs-tools ltrace.conf pam.d resolvconf sysctl.d
apm default inputrc lvm passwd resolv.conf systemd
apparmor deluser.conf insserv machine-id passwd- rmt terminfo
apparmor.d depmod.d insserv.conf magic perl rpc thermald
apport dhcp insserv.conf.d magic.mime pm rsyslog.conf timezone
apt dpkg iproute2 mailcap polkit-1 rsyslog.d tmpfiles.d
at.deny ec2_version iscsi mailcap.order pollinate samba ucf.conf
bash.bashrc environment issue manpath.config popularity-contest.conf screenrc udev
bash_completion fonts issue.net mdadm ppp securetty ufw
bash_completion.d fstab kbd mime.types profile security updatedb.conf
bindresvport.blacklist fuse.conf kernel mke2fs.conf profile.d selinux update-manager
binfmt.d gai.conf kernel-img.conf modprobe.d protocols services update-motd.d
byobu groff ldap modules python sgml update-notifier
ca-certificates group ld.so.cache modules-load.d python2.7 shadow vim
ca-certificates.conf group- ld.so.conf mtab python3 shadow- vmware-tools
calendar grub.d ld.so.conf.d nanorc python3.5 shells vtrgb
cloud gshadow legal network rc0.d skel waagent.conf
console-setup gshadow- libaudit.conf NetworkManager rc1.d sos.conf wgetrc
cron.d gss libnl-3 networks rc2.d ssh X11
cron.daily hdparm.conf locale.alias newt rc3.d ssl xdg
cron.hourly host.conf locale.gen nscd.conf rc4.d subgid xml
cron.monthly hostname localtime nsswitch.conf rc5.d subgid- zsh_command_not_found
crontab hosts logcheck opt rc6.d subuid
cron.weekly hosts.allow login.defs os-release rc.local subuid-
crypttab hosts.deny logrotate.conf overlayroot.conf rcS.d sudoers
root@20533E0701-vm0:/etc# apt-get install docker
E: dpkg was interrupted, you must manually run ‘sudo dpkg –configure -a’ to correct the problem.
root@20533E0701-vm0:/etc# unme
No command ‘unme’ found, did you mean:
Command ‘uname’ from package ‘coreutils’ (main)
unme: command not found
root@20533E0701-vm0:/etc# uname
Linux
root@20533E0701-vm0:/etc# uname —
–all –help –kernel-release –machine –operating-system –version
–hardware-platform –kernel-name –kernel-version –nodename –processor
root@20533E0701-vm0:/etc# uname —
–all –help –kernel-release –machine –operating-system –version
–hardware-platform –kernel-name –kernel-version –nodename –processor
root@20533E0701-vm0:/etc# uname –kernel-name
Linux
root@20533E0701-vm0:/etc# uname –kernel-release
4.13.0-1018-azure
root@20533E0701-vm0:/etc# service docker stop
root@20533E0701-vm0:/etc# service docker status
● docker.service – Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: https://docs.docker.com

Jun 28 02:33:32 20533E0701-vm0 systemd[1]: Stopped Docker Application Container Engine.
root@20533E0701-vm0:/etc# service docker start
Job for docker.socket failed. See «systemctl status docker.socket» and «journalctl -xe» for details.
A dependency job for docker.service failed. See ‘journalctl -xe’ for details.
root@20533E0701-vm0:/etc# systemctl status docker.socket
● docker.socket – Docker Socket for the API
Loaded: loaded (/lib/systemd/system/docker.socket; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-06-28 02:33:54 UTC; 25s ago
Listen: /var/run/docker.sock (Stream)

Jun 28 02:33:54 20533E0701-vm0 systemd[1]: Starting Docker Socket for the API.
Jun 28 02:33:54 20533E0701-vm0 systemd[1]: docker.socket: Control process exited, code=exited status=216
Jun 28 02:33:54 20533E0701-vm0 systemd[1]: Failed to listen on Docker Socket for the API.
Jun 28 02:33:54 20533E0701-vm0 systemd[1]: docker.socket: Unit entered failed state.
root@20533E0701-vm0:/etc# nano /lib/systemd/system/docker.service
root@20533E0701-vm0:/etc# rpm
The program ‘rpm’ is currently not installed. You can install it by typing:
apt install rpm
root@20533E0701-vm0:/etc# yum
The program ‘yum’ is currently not installed. You can install it by typing:
apt install yum
root@20533E0701-vm0:/etc# dpkg
dpkg: error: need an action option

Type dpkg –help for help about installing and deinstalling packages [*];
Use ‘apt’ or ‘aptitude’ for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg –force-help for a list of forcing options;
Type dpkg-deb –help for help about manipulating *.deb files;

Options marked [*] produce a lot of output – pipe it through ‘less’ or ‘more’ !
root@20533E0701-vm0:/etc# apt-get install docker
E: dpkg was interrupted, you must manually run ‘sudo dpkg –configure -a’ to correct the problem.
root@20533E0701-vm0:/etc# sudo dpkg –configure -a
Processing triggers for ureadahead (0.100.0-19) …
Setting up libc-bin (2.23-0ubuntu10) …
Processing triggers for systemd (229-4ubuntu21.2) …
Setting up libltdl7:amd64 (2.4.6-0.1) …
Processing triggers for man-db (2.7.5-1) …
Setting up docker-ce (18.05.0~ce~3-0~ubuntu) …
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(group) request, exiting
Processing triggers for libc-bin (2.23-0ubuntu10) …
Processing triggers for systemd (229-4ubuntu21.2) …
Processing triggers for ureadahead (0.100.0-19) …
root@20533E0701-vm0:/etc# apt-get install docker
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
docker
0 upgraded, 1 newly installed, 0 to remove and 43 not upgraded.
Need to get 12.2 kB of archives.
After this operation, 65.5 kB of additional disk space will be used.
Get:1 http://azure.archive.ubuntu.com/ubuntu xenial/universe amd64 docker amd64 1.5-1 [12.2 kB]
Fetched 12.2 kB in 0s (749 kB/s)
Selecting previously unselected package docker.
(Reading database … 54714 files and directories currently installed.)
Preparing to unpack …/docker_1.5-1_amd64.deb …
Unpacking docker (1.5-1) …
Processing triggers for man-db (2.7.5-1) …
Setting up docker (1.5-1) …
root@20533E0701-vm0:/etc# service docker start
root@20533E0701-vm0:/etc# docker run -d -p 80:80 –restart=always nginx
Unable to find image ‘nginx:latest’ locally
latest: Pulling from library/nginx
683abbb4ea60: Pull complete
a58abb4a7990: Pull complete
b43279c1d51c: Pull complete
Digest: sha256:62a095e5da5f977b9f830adaf64d604c614024bf239d21068e4ca826d0d629a4
Status: Downloaded newer image for nginx:latest
df8be4dcd834760faf03e6cf00bf0145b9548509a94100660754f8f8ecef6538
root@20533E0701-vm0:/etc#

Publicada el
Categorizado como Azure

Dejar un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *