浏览代码

ensure mount in commit

Victor Vieux 12 年之前
父节点
当前提交
f385f1860b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      builder.go

+ 4 - 0
builder.go

@@ -124,6 +124,10 @@ func (builder *Builder) Create(config *Config) (*Container, error) {
 func (builder *Builder) Commit(container *Container, repository, tag, comment, author string, config *Config) (*Image, error) {
 	// FIXME: freeze the container before copying it to avoid data corruption?
 	// FIXME: this shouldn't be in commands.
+	if err := container.EnsureMounted(); err != nil {
+		return nil, err
+	}
+
 	rwTar, err := container.ExportRw()
 	if err != nil {
 		return nil, err