Skip to content

Commit

Permalink
Use a working mysql image on arm64 arch
Browse files Browse the repository at this point in the history
  • Loading branch information
orlangure committed Jun 18, 2022
1 parent 0100668 commit 40239ee
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
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)
}

0 comments on commit 40239ee

Please sign in to comment.