         command.after = c.after
         @commands[i] = command
         return command
-    @add(command)
+    @add(command, label)
   build: (dockerfile = [], context = new FinalizingContext(new Pack()))->
     commands = clone(@commands)
     from = commands.filter((c) -> c.constructor == From)[0]

        throw new Error("Add/Override this command to Dockerfile first")
      @after = after
      return @
    command.next = (next) ->
      dockerfile.add(next).doAfter(@)
      # Updates the first element in the tight group
      next.doAfter = (after) => @doAfter(after)
      return next
    return command
  override: (command) ->
    unless command.overrides()
      throw new Error("This command does not override")
    for c, i in @commands

    context.entry({name: '/Dockerfile'}, dockerfile.join("\n"))
    context.finalize()
    return context
  findByLabel: (label) ->
    for e in @labels
      return e.command if e.label is label
    return undefined

module.exports = Dockerfile
