Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a working mysql image on arm64 arch #569

Merged
merged 1 commit into from Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions preset/mysql/preset.go
@@ -1,4 +1,11 @@
// Package mysql provides a Gnomock Preset for MySQL database
// Package mysql provides a Gnomock Preset for MySQL database.
//
// This preset uses different docker images for amd64 and arm64 architectures.
// Even though the versions should be compatible, you should make sure that the
// tag being used exists in the following repositories:
//
// amd64: https://hub.docker.com/_/mysql/
// arm64: https://hub.docker.com/r/mysql/mysql-server
package mysql

import (
Expand Down Expand Up @@ -55,11 +62,6 @@ type P struct {
Version string `json:"version"`
}

// Image returns an image that should be pulled to create this container.
func (p *P) Image() string {
return fmt.Sprintf("docker.io/library/mysql:%s", p.Version)
}

// Ports returns ports that should be used to access this container.
func (p *P) Ports() gnomock.NamedPorts {
return gnomock.DefaultTCP(defaultPort)
Expand Down
10 changes: 10 additions & 0 deletions preset/mysql/preset_amd64.go
@@ -0,0 +1,10 @@
package mysql

import (
"fmt"
)

// Image returns an image that should be pulled to create this container.
func (p *P) Image() string {
return fmt.Sprintf("docker.io/library/mysql:%s", p.Version)
}
10 changes: 10 additions & 0 deletions preset/mysql/preset_arm64.go
@@ -0,0 +1,10 @@
package mysql

import (
"fmt"
)

// Image returns an image that should be pulled to create this container.
func (p *P) Image() string {
return fmt.Sprintf("docker.io/mysql/mysql-server:%s", p.Version)
}