mysql_in_docker 0.0.3 → 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/Gemfile.lock +1 -1
- data/lib/commands.rb +13 -5
- data/lib/mysql_in_docker/version.rb +1 -1
- metadata +1 -1
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/Gemfile.lock
CHANGED
data/lib/commands.rb
CHANGED
@@ -61,21 +61,29 @@ 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
|
+
|
64
68
|
def get_image_name(version)
|
65
|
-
|
66
|
-
image = is_arm ? "mysql/mysql-server" : "mysql"
|
69
|
+
image = arm? ? "mysql/mysql-server" : "mysql"
|
67
70
|
|
68
|
-
return "#{image}:8.0" if
|
71
|
+
return "#{image}:8.0" if arm? && version == "8"
|
69
72
|
|
70
73
|
"#{image}:#{version}"
|
71
74
|
end
|
72
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
|
+
|
73
82
|
def up_command(id, version, port, mysql_root_password) # rubocop:disable Metrics/MethodLength
|
74
83
|
[
|
75
84
|
"run",
|
76
85
|
"--name", get_container_name(id),
|
77
|
-
|
78
|
-
"MYSQL_ROOT_PASSWORD=#{mysql_root_password}",
|
86
|
+
*get_envs(mysql_root_password),
|
79
87
|
"--publish",
|
80
88
|
"#{port}:3306",
|
81
89
|
"--volume",
|