docker run -d --network site --name one -P nginxdemos/hello
docker run -d --network site --name two --link one -P nginxdemos/hello
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
40132d06643d nginxdemos/hello "nginx -g 'daemon of…" 3 seconds ago Up 1 second 0.0.0.0:32772->80/tcp two
5b6100f38e7d nginxdemos/hello "nginx -g 'daemon of…" 56 seconds ago Up 54 seconds 0.0.0.0:32771->80/tcp one
docker exec -it 5b6 /bin/sh
/ # ping one
PING one (172.18.0.2): 56 data bytes
64 bytes from 172.18.0.2: seq=0 ttl=64 time=0.081 ms
64 bytes from 172.18.0.2: seq=1 ttl=64 time=0.128 ms
Пробовал подключать через http//:touristbasa/localhost/views/layouts/style.css' но что-то не так наверное написал - не нашел файла
<link href="http://touristbasa/views/layouts/style.css" type="text/css" rel="stylesheet" />
<link href="/views/layouts/style.css" type="text/css" rel="stylesheet" />
package main
import (
"log"
"time"
)
func add(ch chan<- string) {
for {
time.Sleep(time.Second * 2)
ch <- "hi"
}
}
func exit(ch chan<- string) {
time.Sleep(time.Second * 5)
ch <- "close"
}
func main() {
ch := make(chan string, 1000)
go add(ch)
go exit(ch)
LOOP:
for {
select {
case val := <- ch:
switch val {
case "close":
log.Println("Close")
break LOOP
case "hi":
log.Println("Hi")
}
default:
log.Println("Default")
time.Sleep(time.Second * 1)
}
}
}
func loop(i int) {
n := 0
loop:
for {
select {
case <-m[i]:
break loop
default:
fmt.Println(n)
time.Sleep(500 * time.Millisecond)
n++
}
}
}
func loop() {
n := 0
c := time.After(2*time.Second)
loop:
for {
select {
case <-c:
break loop
default:
fmt.Println(n)
time.Sleep(500 * time.Millisecond)
n++
}
}
}
const input1 = document.querySelector('#input1');
const input2 = document.querySelector('#input2');
const button = document.querySelector('#button');
function check2() {
if (input1.value != '' && input2.value != '') {
button.disabled = false;
} else {
button.disabled = true;
}
}
const getReversedPaths = (arr, path = []) =>
arr.reduce((acc, { childItems, ...item }) => {
path.push(item);
if (childItems) {
acc.push(...getReversedPaths(childItems, path));
} else {
acc.push(path.length > 1
? path.map(({ packingLevel }, i, a) => ({ ...a[a.length - i - 1], packingLevel }))
: [ path[0] ]
);
}
path.pop();
return acc;
}, []);
const reverseThere = arr =>
getReversedPaths(arr).map(n =>
n.reduceRight((child, parent) => ({ ...parent, childItems: [ child ] }))
);
const reverseBackAgain = arr =>
(function createTree(arr) {
return Object.values(arr.reduce((acc, [ head, ...tail ]) => {
if (tail.length) {
(acc[head.name] = acc[head.name] || { ...head, childItems: [] }).childItems.push(tail);
} else {
acc[head.name] = head;
}
return acc;
}, {})).map(n => (n.childItems && (n.childItems = createTree(n.childItems)), n));
})(getReversedPaths(arr));