-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainer.sh
More file actions
38 lines (27 loc) · 704 Bytes
/
Copy pathcontainer.sh
File metadata and controls
38 lines (27 loc) · 704 Bytes
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
#!/usr/bin/bash
# Desplay docker version
echo "Your docker version is"
docker -v
# Hold the terminal for few seconds
sleep 3
# Ask the image name from the user
echo "Enter image name"
read image_name
# Hold the terminal for few seconds
sleep 3
# Ask the container name from the user
echo "Enter container_name"
read container_name
# Hold the terminal for few seconds
sleep 3
# Ask the host name from the user
echo "Enter host name"
read host_name
# Hold the terminal for few seconds
sleep 3
# Pull the the image if it dosn't exit
docker pull $image_name
# Hold the terminal for few seconds
sleep 3
# Creating the container
docker run -it --name $container_name -h $host_name $image_name bash