You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
4.9 KiB
156 lines
4.9 KiB
4 years ago
|
= Docker Intro !
|
||
|
Apostolos rootApostolos@swarmlab.io
|
||
|
// Metadata:
|
||
|
:description: Intro and Install
|
||
|
:keywords: iot, swarm. docker
|
||
|
:data-uri:
|
||
|
:toc: right
|
||
|
:toc-title: Πίνακας περιεχομένων
|
||
|
:toclevels: 4
|
||
|
:source-highlighter: highlight
|
||
|
:icons: font
|
||
|
:sectnums:
|
||
|
|
||
|
|
||
|
|
||
|
{empty} +
|
||
|
|
||
|
|
||
|
To Docker είναι μια πλατφόρμα λογισμικού ανοιχτού κώδικα που υλοποιεί Εικονικοποίηση (Virtualization) σε επίπεδο Λειτουργικού Συστήματος.
|
||
|
|
||
|
Tο Docker προσφέρει αυτοματοποιημένες διαδικασίες για την ανάπτυξη εφαρμογών σε απομονωμένες Περιοχές Χρήστη (User Spaces) που ονομάζονται Software Containers
|
||
|
|
||
|
Το λογισμικό χρησιμοποιεί τεχνολογιές του πυρήνα του Linux όπως τα cgroups και οι χώροι ονομάτων πυρήνα (kernel namespaces), για να επιτρέπει σε ανεξάρτητα software containers να εκτελούνται στο ίδιο λειτουργικό σύστημα.
|
||
|
|
||
|
Έτσι αποφεύγεται η χρήση επιπλέον υπολογιστικών πόρων που θα απαιτούσε μια εικονική μηχανή (virtual machine).
|
||
|
Ορισμός, βασικά χαρακτηριστικά και αρχιτεκτονικές IoT, εφαρμογές ΙοΤ, αντιδιαστολή με τον ιστό των αντικειμένων (Web of Things / WoT), προκλήσεις του IoT όπως προτυποποίηση, κλιμάκωση, μέγεθος συσκευών, κατανάλωση ενέργειας, διευθυνσιοδότηση, ασφάλεια/ιδιωτικότητα, ποιότητας υπηρεσιών, κινητικότητα κ.α
|
||
|
|
||
|
More Info +
|
||
|
https://en.wikipedia.org/wiki/Docker_(software)[^]
|
||
|
|
||
|
[[cheat-Dockervideo]]
|
||
|
== docker Intro
|
||
|
|
||
|
* Docker - Explained
|
||
|
+
|
||
|
video::wi-MGFhrad0[youtube]
|
||
|
|
||
|
* How DOCKER works - Virtualization vs containerization
|
||
|
+
|
||
|
video::0e-KiGJIiDc[youtube]
|
||
|
|
||
|
[[cheat-Docker]]
|
||
|
== Installation (Ubuntu)
|
||
|
|
||
|
```
|
||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||
|
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||
|
sudo apt update
|
||
|
|
||
|
sudo apt install -y docker-ce
|
||
|
echo "or"
|
||
|
sudo apt install docker*
|
||
|
|
||
|
sudo systemctl status docker
|
||
|
sudo usermod -aG docker username #οπου username το όνομα του χρήστη που θα δουλεύει με docker
|
||
|
```
|
||
|
|
||
|
|
||
|
[[cheat-compose]]
|
||
|
== docker-compose
|
||
|
|
||
|
```
|
||
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||
|
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
||
|
```
|
||
|
|
||
|
|
||
|
[[cheat-error]]
|
||
|
== On Error:
|
||
|
|
||
|
=== Get https ://registry.vlabs.uniwa.gr:5080/v2/: x509: certificate
|
||
|
|
||
|
```
|
||
|
Pulling ...
|
||
|
ERROR: Get https://registry.vlabs.uniwa.gr:5080/v2/: x509: certificate signed by unknown authority
|
||
|
```
|
||
|
|
||
|
- run
|
||
|
|
||
|
```
|
||
|
$ sudo su
|
||
|
# touch set-ca.sh
|
||
|
```
|
||
|
- copy-paste lines
|
||
|
|
||
|
```
|
||
|
registry_address=registry.vlabs.uniwa.gr
|
||
|
registry_port=5043
|
||
|
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
|
||
|
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
|
||
|
registry_port=5080
|
||
|
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
|
||
|
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
|
||
|
|
||
|
registry_address=hub.swarmlab.io
|
||
|
registry_port=5443
|
||
|
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
|
||
|
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
|
||
|
|
||
|
registry_port=5480
|
||
|
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
|
||
|
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
|
||
|
|
||
|
```
|
||
|
|
||
|
|
||
|
=== exec file
|
||
|
|
||
|
```
|
||
|
sudo bash ./set-ca.sh
|
||
|
```
|
||
|
|
||
|
=== Error response from daemon
|
||
|
|
||
|
```
|
||
|
docker: Error response from daemon: Get https://registry.vlabs.uniwa.gr:5080/v2/: dial tcp: lookup registry.vlabs.uniwa.gr on [::1]:53: read udp [::1]:56425->[::1]:53: read: connection refused.
|
||
|
```
|
||
|
|
||
|
Try again!
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
Happy coding :-)
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
:hardbreaks:
|
||
|
|
||
|
{empty} +
|
||
|
{empty} +
|
||
|
{empty}
|
||
|
|
||
|
:!hardbreaks:
|
||
|
|
||
|
'''
|
||
|
|
||
|
.Reminder
|
||
|
[NOTE]
|
||
|
====
|
||
|
:hardbreaks:
|
||
|
Caminante, no hay camino,
|
||
|
se hace camino al andar.
|
||
|
|
||
|
Wanderer, there is no path,
|
||
|
the path is made by walking.
|
||
|
|
||
|
*Antonio Machado* Campos de Castilla
|
||
|
====
|