-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask-3.js
More file actions
97 lines (91 loc) · 2.47 KB
/
task-3.js
File metadata and controls
97 lines (91 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const registry = new Container({
position: {
x: 500,
y: 100,
},
width: 200,
height: 100,
label: "Registry (https://hub.docker.com)"
});
const host = new Container({
position: {
x: 50,
y: 250,
},
width: 500,
height: 300,
label: "Host"
});
const images = new Container({
position: {
x: 340,
y: 340,
},
width: 200,
height: 200,
label: "Images",
style: {
backgroundColor: 'white'
}
});
const containers = new Container({
position: {
x: 110,
y: 340,
},
width: 200,
height: 200,
label: "Containers",
style: {
backgroundColor: 'white'
}
});
const helloWorldImage = new DockerImage({
position: {x: 550, y: 130},
imageSrc: "./img/hello-world-logo.png",
scale: 3,
name: 'hello-world',
animations: {
pull : {movement:[['x', -150], ['y', 250]]},
run: {
timeout: 1000,
movement: [['x', -200, 2000]]
}
},
logs: {
run: [[3000, "\r\n" +
"Hello from Docker!\r\n" +
"This message shows that your installation appears to be working correctly.\r\n" +
"\r\n" +
"To generate this message, Docker took the following steps:\r\n" +
" 1. The Docker client contacted the Docker daemon.\r\n" +
" 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\r\n" +
" (amd64)\r\n" +
" 3. The Docker daemon created a new container from that image which runs the\r\n" +
" executable that produces the output you are currently reading.\r\n" +
" 4. The Docker daemon streamed that output to the Docker client, which sent it\r\n" +
" to your terminal.\r\n" +
"\r\n" +
"To try something more ambitious, you can run an Ubuntu container with:\r\n" +
" $ docker run -it ubuntu bash\r\n" +
"\r\n" +
"Share images, automate workflows, and more with a free Docker ID:\r\n" +
" https://hub.docker.com/\r\n" +
"\r\n" +
"For more examples and ideas, visit:\r\n" +
" https://docs.docker.com/get-started/\r\n" +
"\r\n" +
"\r\n"
]]
}
});
async function taskInputHandle() {
if (input.command === 'run') {
const img = imagesArr.find((image)=> image.name === input.name)
if (img) {
await img.runImage()
} else {
setConsoleToNewLine()
}
}
}