diff --git a/core/manager/pipeline.go b/core/manager/pipeline.go index a9ae2d22..b828fd28 100644 --- a/core/manager/pipeline.go +++ b/core/manager/pipeline.go @@ -266,6 +266,7 @@ func deployChallenge(challenge *database.Challenge, config cfg.BeastChallengeCon MountsMap: staticMount, ImageId: challenge.ImageId, ContainerName: coreUtils.EncodeID(config.Challenge.Metadata.Name), + ChallengeName: config.Challenge.Metadata.Name, ContainerEnv: containerEnv, ContainerNetwork: containerNetwork, Traffic: config.Challenge.Env.TrafficType(), diff --git a/pkg/cr/containers.go b/pkg/cr/containers.go index 777e8f4c..51e237dd 100644 --- a/pkg/cr/containers.go +++ b/pkg/cr/containers.go @@ -56,6 +56,7 @@ type CreateContainerConfig struct { MountsMap map[string]string ImageId string ContainerName string + ChallengeName string ContainerEnv []string ContainerNetwork string Traffic TrafficType @@ -141,7 +142,7 @@ func StopAndRemoveContainer(containerId string) error { } func CreateContainerFromImage(containerConfig *CreateContainerConfig) (string, error) { - containerName := containerConfig.ContainerName + containerName := fmt.Sprintf("beast_%s_%s", containerConfig.ChallengeName, containerConfig.ContainerName[:3]) ctx := context.Background() cli, err := client.NewEnvClient() if err != nil {