rabin 1 year ago
parent
commit
47ee365d34
3 changed files with 11 additions and 8 deletions
  1. 1 1
      src/docker/build/db/mysql/Dockerfile
  2. 2 2
      src/docker/conf/web.conf
  3. 8 5
      src/tool/docker.py

+ 1 - 1
src/docker/build/db/mysql/Dockerfile

@@ -1,3 +1,3 @@
-FROM mysql:latest
+FROM mysql:5.7
 
 MAINTAINER Rabin "https://github.com/shemic"

+ 2 - 2
src/docker/conf/web.conf

@@ -2,13 +2,13 @@
 path = {base}
 default = mysql,php7,nginx
 
-[#mysql]
+[mysql]
 #port = 3309:3306
 volumes = {container}conf/db/mysql:/etc/mysql,/data/mysql/{name}/data:/var/lib/mysql
 environment = MYSQL_ROOT_PASSWORD=123456
 alias = mysql
 
-[mysql]
+[#mysql]
 #使用mariadb来代替mysql
 image = mariadb
 #port = 3310:3306

+ 8 - 5
src/tool/docker.py

@@ -297,7 +297,10 @@ class Docker_Action(object):
 
 	@staticmethod
 	def rmi():
-		Image.delete(Args.name)
+		if Args.name:
+			Image.delete(Args.name)
+		else:
+			Image.delete()
 		print('rm image:yes')
 
 	@staticmethod
@@ -550,11 +553,11 @@ class Image(object):
 	def show():
 		print(Core.shell('image.show'))
 	@staticmethod
-	def drop(name=''):
-		Core.shell('image.drop ' + name, bg=True)
+	def drop():
+		Core.shell('image.drop', bg=True)
 	@staticmethod
-	def delete():
-		Core.shell('image.rm', bg=True)
+	def delete(name=''):
+		Core.shell('image.rm ' + name, bg=True)
 	@staticmethod
 	def build(root, path, name):
 		file = Core.path + Docker.path + 'build/' + path + '/'