13
|
1 /* Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License */
|
|
2 #ifndef IE_DOCKER
|
|
3
|
19
|
4 #define base_exec_command "/usr/bin/docker"
|
23
|
5 #define ps_exec_command "/usr/bin/docker ps"
|
19
|
6
|
13
|
7 #define run_command "run"
|
19
|
8 #define build_command ""
|
13
|
9 #define attach_command "attach"
|
|
10 // #define pull_command "pull" /* download docker image command */
|
19
|
11 #define images_command "" /* list images command */
|
|
12 #define commit_command "" /* make image command */
|
13
|
13 #define rm_command "rm" /* remove container command */
|
|
14 #define rmi_command "rmi" /* remove image command */
|
19
|
15 #define start_command "start"
|
|
16 #define stop_command "stop"
|
13
|
17 #define exec_command "exec"
|
19
|
18 #define cp_command "cp"
|
|
19 #define ps_command "ps"
|
13
|
20
|
19
|
21 #define create_command ""
|
13
|
22
|
21
|
23 #define run_options "-it -u 2015 "
|
|
24 #define base_image_name "java-centos"
|
|
25 #define run_shell "zsh"
|
|
26 #define cp_file_path "/tmp"
|
|
27
|
13
|
28 /* Define global variables */
|
|
29
|
|
30 const char *guests[] = {"mata"};
|
|
31 const char *managers[] = {"taira"};
|
|
32 const char students_sym[] = "students";
|
|
33 const char managers_sym[] = "managers";
|
|
34 const char guests_sym[] = "guests";
|
|
35 const char delimiter[] = "_";
|
16
|
36 const char portlist_file[] = "/etc/iedocker/iedockerport.list";
|
13
|
37
|
19
|
38 enum {
|
13
|
39 NAME_LENGTH = 50,
|
|
40 PS_NAME_LENGTH = 50,
|
|
41 RUN_COMMAND_LENGTH = 1024,
|
|
42 PORT_LENGTH = 16,
|
|
43 BUFF_SIZE = 50
|
|
44 };
|
|
45
|
19
|
46 enum {
|
13
|
47 STUDENTS,
|
|
48 GUESTS,
|
|
49 MANAGERS
|
|
50 };
|
|
51
|
|
52 #define PSNAME_MAX (512)
|
|
53
|
|
54 typedef struct pslist {
|
|
55 char name[PSNAME_MAX];
|
|
56 struct pslist *next;
|
|
57 } PSLIST, *PSLISTPTR;
|
|
58
|
|
59 #define NEW(type) ((type*)malloc(sizeof(type)))
|
|
60
|
|
61 /* docker run option
|
|
62 * -t tty
|
|
63 * --name [process name]
|
|
64 * -v volume
|
|
65 * -m memory
|
|
66 * image name
|
19
|
67 * -i skeep open tdin
|
13
|
68 */
|
|
69
|
|
70 enum {
|
|
71 FALSE = 0,
|
|
72 TRUE = 1
|
|
73 };
|
|
74
|
16
|
75 typedef struct exec_command_opt_t {
|
|
76 int tty; // true = 1; false = 0
|
|
77 int dettach; // true = 1; false = 0
|
|
78 int interactive; // true = 1; false = 0
|
|
79 char ps_name[64]; // user decide name
|
|
80 char exec_ps_command[64];
|
|
81 } exec_command_opt;
|
|
82
|
13
|
83 typedef struct run_command_opt_t {
|
|
84 char memory[16];
|
|
85 char innerport[PORT_LENGTH];
|
|
86 char outerport[PORT_LENGTH]; // system decide port number
|
|
87 int tty; // true = 1; false = 0
|
|
88 int dettach; // true = 1; false = 0
|
|
89 int interactive; // true = 1; false = 0
|
|
90 char ps_name[64]; // user decide name
|
19
|
91 char exec_ps_command[64]; //
|
13
|
92 char volume[128];
|
|
93 char image_name[16];
|
|
94 } run_command_opt;
|
|
95
|
16
|
96
|
13
|
97 #endif /* IE_DOCKER */
|