[lxc-devel] [lxd/master] Use sql to update db for docker profile

hallyn on Github lxc-bot at linuxcontainers.org
Mon Feb 29 18:25:17 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160229/066bcbcf/attachment.bin>
-------------- next part --------------
From b46165c1a8240aebddfff7b0aba52d589de0dca3 Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge.hallyn at ubuntu.com>
Date: Fri, 26 Feb 2016 16:07:48 -0800
Subject: [PATCH] Use sql to update db for docker profile

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 lxd/db_update.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lxd/db_update.go b/lxd/db_update.go
index c3cfa44..57cec94 100644
--- a/lxd/db_update.go
+++ b/lxd/db_update.go
@@ -16,10 +16,12 @@ import (
 )
 
 func dbUpdateFromV25(db *sql.DB) error {
-	if err := dbProfileCreateDocker(db); err != nil {
-		return err
-	}
 	stmt := `
+INSERT INTO profiles (name, description) VALUES ("docker", "Profile supporting docker in containers");
+INSERT INTO profiles_config (profile_id, key, value) SELECT id, "security.nesting", "true" FROM profiles WHERE name="docker";
+INSERT INTO profiles_config (profile_id, key, value) SELECT id, "linux.kernel_modules", "overlay, nf_nat" FROM profiles WHERE name="docker";
+INSERT INTO profiles_devices (profile_id, name, type) SELECT id, "fuse", "unix-char" FROM profiles WHERE name="docker";
+INSERT INTO profiles_devices_config (profile_device_id, key, value) SELECT profiles_devices.id, "path", "/dev/fuse" FROM profiles_devices LEFT JOIN profiles WHERE profiles_devices.profile_id = profiles.id AND profiles.name = "docker";
 INSERT INTO schema (version, updated_at) VALUES (?, strftime("%s"));`
 	_, err := db.Exec(stmt, 26)
 	return err


More information about the lxc-devel mailing list