Browse code

Change dockerbulder format, no more tabs and COPY becomes INSERT to avoid conflict with contrib script

Guillaume J. Charmes authored on 2013/05/02 05:45:35
Showing 1 changed files
... ...
@@ -142,7 +142,7 @@ func (builder *Builder) Build(dockerfile io.Reader, stdout io.Writer) (*Image, e
142 142
 		if len(line) == 0 || line[0] == '#' {
143 143
 			continue
144 144
 		}
145
-		tmp := strings.SplitN(line, "	", 2)
145
+		tmp := strings.SplitN(line, " ", 2)
146 146
 		if len(tmp) != 2 {
147 147
 			return nil, fmt.Errorf("Invalid Dockerfile format")
148 148
 		}
... ...
@@ -192,13 +192,13 @@ func (builder *Builder) Build(dockerfile io.Reader, stdout io.Writer) (*Image, e
192 192
 			image = base
193 193
 
194 194
 			break
195
-		case "copy":
195
+		case "insert":
196 196
 			if image == nil {
197 197
 				return nil, fmt.Errorf("Please provide a source image with `from` prior to copy")
198 198
 			}
199 199
 			tmp2 := strings.SplitN(tmp[1], " ", 2)
200 200
 			if len(tmp) != 2 {
201
-				return nil, fmt.Errorf("Invalid COPY format")
201
+				return nil, fmt.Errorf("Invalid INSERT format")
202 202
 			}
203 203
 			fmt.Fprintf(stdout, "COPY %s to %s in %s\n", tmp2[0], tmp2[1], base.ShortId())
204 204
 
... ...
@@ -240,7 +240,7 @@ func (builder *Builder) Build(dockerfile io.Reader, stdout io.Writer) (*Image, e
240 240
 
241 241
 			break
242 242
 		default:
243
-			fmt.Fprintf(stdout, "Skipping unknown op %s\n", tmp[0])
243
+			fmt.Fprintf(stdout, "Skipping unknown instruction %s\n", instruction)
244 244
 		}
245 245
 	}
246 246
 	if base != nil {