mysql_in_docker 0.0.1 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bundle/config +3 -1
- data/Gemfile.lock +2 -1
- data/lib/commands.rb +22 -5
- data/lib/mysql_in_docker/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a20304825a647b19b445ef478c2e0669c601fae18abd804c412481bf1ac5b1b
|
4
|
+
data.tar.gz: 0dfc6453132f63ec36c7c5658ed2e3f68bee2debc7a2185453459078fce41004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22789a1b94b68a5e6c6368e3a9733514ebafa2e209ede922d7aba185b823fdd681f5a8197c21b9cd4b2ccc3cc94ea61e2f8ec69e884391860ffb47d79d741828
|
7
|
+
data.tar.gz: 728b10cbe380287fc28263eceb3de6fdf303a5488350dfa077742496052065b61960852aad4e38d0f52a73143842858490b857470d8ca5e21447dfd7fbfb287f
|
data/.bundle/config
CHANGED
data/Gemfile.lock
CHANGED
data/lib/commands.rb
CHANGED
@@ -34,8 +34,8 @@ module MysqlInDocker
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
desc "
|
38
|
-
def
|
37
|
+
desc "remove ID", "Remove mysql container and volume."
|
38
|
+
def remove(id)
|
39
39
|
stop id
|
40
40
|
|
41
41
|
status = docker_command "volume rm #{get_container_name(id)}"
|
@@ -61,18 +61,35 @@ module MysqlInDocker
|
|
61
61
|
"mysql_in_docker_#{id}"
|
62
62
|
end
|
63
63
|
|
64
|
+
def arm?
|
65
|
+
RUBY_PLATFORM.start_with? "arm"
|
66
|
+
end
|
67
|
+
|
68
|
+
def get_image_name(version)
|
69
|
+
image = arm? ? "mysql/mysql-server" : "mysql"
|
70
|
+
|
71
|
+
return "#{image}:8.0" if arm? && version == "8"
|
72
|
+
|
73
|
+
"#{image}:#{version}"
|
74
|
+
end
|
75
|
+
|
76
|
+
def get_envs(mysql_root_password)
|
77
|
+
arr = ["--env", "MYSQL_ROOT_PASSWORD=#{mysql_root_password}"]
|
78
|
+
arr.concat ["--env", "MYSQL_ROOT_HOST=%"] if arm?
|
79
|
+
arr
|
80
|
+
end
|
81
|
+
|
64
82
|
def up_command(id, version, port, mysql_root_password) # rubocop:disable Metrics/MethodLength
|
65
83
|
[
|
66
84
|
"run",
|
67
85
|
"--name", get_container_name(id),
|
68
|
-
|
69
|
-
"MYSQL_ROOT_PASSWORD=#{mysql_root_password}",
|
86
|
+
*get_envs(mysql_root_password),
|
70
87
|
"--publish",
|
71
88
|
"#{port}:3306",
|
72
89
|
"--volume",
|
73
90
|
"#{get_container_name(id)}:/var/lib/mysql",
|
74
91
|
"-d",
|
75
|
-
|
92
|
+
get_image_name(version)
|
76
93
|
].join(" ")
|
77
94
|
end
|
78
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_in_docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sijia Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.3.7
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Easly use mysql with docker.
|