Skip to content

Commit

Permalink
Merge pull request #13 from synalice/fix/issue-8
Browse files Browse the repository at this point in the history
Merge fix/issue-8
  • Loading branch information
synalice authored Jun 11, 2022
2 parents fdf0693 + 4d051de commit 447063a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/container/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package container
import (
"context"
"fmt"
"strings"

"github.com/docker/docker/api/types"
"github.com/google/uuid"
Expand Down Expand Up @@ -100,6 +101,10 @@ func (b *Builder) setTimeLimit() *Builder {

// generateUUIDName generates unique UUID name for each new container
func (b *Builder) generateUUIDName() (containerName string) {
if strings.Contains(b.config.ContainerConfig.Image, ":") {
newImgName := strings.Replace(b.config.ContainerConfig.Image, ":", "-", -1)
return "gobox" + "-" + newImgName + "-" + uuid.NewString()
}
return "gobox" + "-" + b.config.ContainerConfig.Image + "-" + uuid.NewString()
}

Expand Down

0 comments on commit 447063a

Please sign in to comment.