diff --git a/container_test.go b/container_test.go index 16411283c6..72927bc55a 100644 --- a/container_test.go +++ b/container_test.go @@ -167,7 +167,7 @@ func Test_BuildImageWithContexts(t *testing.T) { }{ { Name: "Dockerfile", - Contents: `FROM docker.io/alpine + Contents: `FROM alpine CMD ["echo", "this is from the archive"]`, }, } @@ -216,7 +216,7 @@ func Test_BuildImageWithContexts(t *testing.T) { }, { Name: "Dockerfile", - Contents: `FROM docker.io/alpine + Contents: `FROM alpine WORKDIR /app COPY . . CMD ["sh", "./say_hi.sh"]`, @@ -365,7 +365,7 @@ func Test_GetLogsFromFailedContainer(t *testing.T) { ctx := context.Background() // directDockerHubReference { req := testcontainers.ContainerRequest{ - Image: "docker.io/alpine", + Image: "alpine", Cmd: []string{"echo", "-n", "I was not expecting this"}, WaitingFor: wait.ForLog("I was expecting this").WithStartupTimeout(5 * time.Second), } @@ -392,11 +392,11 @@ func Test_GetLogsFromFailedContainer(t *testing.T) { type dockerImageSubstitutor struct{} func (s dockerImageSubstitutor) Description() string { - return "DockerImageSubstitutor (prepends docker.io)" + return "DockerImageSubstitutor (prepends registry.hub.docker.com)" } func (s dockerImageSubstitutor) Substitute(image string) (string, error) { - return "docker.io/" + image, nil + return "registry.hub.docker.com/library/" + image, nil } // } @@ -455,7 +455,7 @@ func TestImageSubstitutors(t *testing.T) { name: "Prepend namespace", image: "alpine", substitutors: []testcontainers.ImageSubstitutor{dockerImageSubstitutor{}}, - expectedImage: "docker.io/alpine", + expectedImage: "registry.hub.docker.com/library/alpine", }, { name: "Substitution with error", @@ -554,5 +554,5 @@ func ExampleGenericContainer_withSubstitutors() { fmt.Println(dockerContainer.Image) - // Output: docker.io/alpine:latest + // Output: registry.hub.docker.com/library/alpine:latest } diff --git a/docker_files_test.go b/docker_files_test.go index 6a767e6163..9b8551f325 100644 --- a/docker_files_test.go +++ b/docker_files_test.go @@ -13,6 +13,8 @@ import ( "github.com/testcontainers/testcontainers-go/wait" ) +const testBashImage string = "bash:5.2.26" + func TestCopyFileToContainer(t *testing.T) { ctx, cnl := context.WithTimeout(context.Background(), 30*time.Second) defer cnl() @@ -30,7 +32,7 @@ func TestCopyFileToContainer(t *testing.T) { ctr, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "docker.io/bash", + Image: testBashImage, Files: []testcontainers.ContainerFile{ { Reader: r, @@ -66,7 +68,7 @@ func TestCopyFileToRunningContainer(t *testing.T) { ctr, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "docker.io/bash:5.2.26", + Image: testBashImage, Files: []testcontainers.ContainerFile{ { HostFilePath: waitForPath, @@ -104,7 +106,7 @@ func TestCopyDirectoryToContainer(t *testing.T) { ctr, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "docker.io/bash", + Image: testBashImage, Files: []testcontainers.ContainerFile{ { HostFilePath: dataDirectory, @@ -141,7 +143,7 @@ func TestCopyDirectoryToRunningContainerAsFile(t *testing.T) { ctr, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "docker.io/bash", + Image: testBashImage, Files: []testcontainers.ContainerFile{ { HostFilePath: waitForPath, @@ -183,7 +185,7 @@ func TestCopyDirectoryToRunningContainerAsDir(t *testing.T) { ctr, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "docker.io/bash", + Image: testBashImage, Files: []testcontainers.ContainerFile{ { HostFilePath: waitForPath, diff --git a/docker_test.go b/docker_test.go index d01f21f01f..2cc762a6aa 100644 --- a/docker_test.go +++ b/docker_test.go @@ -29,10 +29,10 @@ import ( ) const ( - mysqlImage = "docker.io/mysql:8.0.36" - nginxDelayedImage = "docker.io/menedev/delayed-nginx:1.15.2" - nginxImage = "docker.io/nginx" - nginxAlpineImage = "docker.io/nginx:alpine" + mysqlImage = "mysql:8.0.36" + nginxDelayedImage = "menedev/delayed-nginx:1.15.2" + nginxImage = "nginx" + nginxAlpineImage = "nginx:alpine" nginxDefaultPort = "80/tcp" nginxHighPort = "8080/tcp" daemonMaxVersion = "1.41" @@ -804,8 +804,8 @@ func Test_BuildContainerFromDockerfileWithBuildLog(t *testing.T) { temp := strings.Split(string(out), "\n") - if !regexp.MustCompile(`^Step\s*1/\d+\s*:\s*FROM docker.io/alpine$`).MatchString(temp[0]) { - t.Errorf("Expected stdout first line to be %s. Got '%s'.", "Step 1/* : FROM docker.io/alpine", temp[0]) + if !regexp.MustCompile(`^Step\s*1/\d+\s*:\s*FROM alpine$`).MatchString(temp[0]) { + t.Errorf("Expected stdout first line to be %s. Got '%s'.", "Step 1/* : FROM alpine", temp[0]) } } @@ -878,7 +878,7 @@ func TestCMD(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/alpine", + Image: "alpine", WaitingFor: wait.ForAll( wait.ForLog("command override!"), ), @@ -904,7 +904,7 @@ func TestEntrypoint(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/alpine", + Image: "alpine", WaitingFor: wait.ForAll( wait.ForLog("entrypoint override!"), ), @@ -930,7 +930,7 @@ func TestWorkingDir(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/alpine", + Image: "alpine", WaitingFor: wait.ForAll( wait.ForLog("/var/tmp/test"), ), @@ -950,7 +950,7 @@ func TestWorkingDir(t *testing.T) { func ExampleDockerProvider_CreateContainer() { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForHTTP("/").WithStartupTimeout(10 * time.Second), } @@ -983,7 +983,7 @@ func ExampleDockerProvider_CreateContainer() { func ExampleContainer_Host() { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForHTTP("/").WithStartupTimeout(10 * time.Second), } @@ -1025,7 +1025,7 @@ func ExampleContainer_Host() { func ExampleContainer_Start() { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForHTTP("/").WithStartupTimeout(10 * time.Second), } @@ -1062,7 +1062,7 @@ func ExampleContainer_Start() { func ExampleContainer_Stop() { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForHTTP("/").WithStartupTimeout(10 * time.Second), } @@ -1096,7 +1096,7 @@ func ExampleContainer_Stop() { func ExampleContainer_MappedPort() { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForHTTP("/").WithStartupTimeout(10 * time.Second), } @@ -1147,7 +1147,7 @@ func TestContainerCreationWithVolumeAndFileWritingToIt(t *testing.T) { bashC, err := GenericContainer(ctx, GenericContainerRequest{ ProviderType: providerType, ContainerRequest: ContainerRequest{ - Image: "docker.io/bash", + Image: "bash:5.2.26", Files: []ContainerFile{ { HostFilePath: absPath, @@ -1167,7 +1167,7 @@ func TestContainerCreationWithVolumeAndFileWritingToIt(t *testing.T) { func TestContainerWithTmpFs(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/busybox", + Image: "busybox", Cmd: []string{"sleep", "10"}, Tmpfs: map[string]string{"/testtmpfs": "rw"}, } @@ -1242,7 +1242,7 @@ func TestContainerNonExistentImage(t *testing.T) { c, err := GenericContainer(ctx, GenericContainerRequest{ ProviderType: providerType, ContainerRequest: ContainerRequest{ - Image: "docker.io/postgres:12", + Image: "postgres:12", WaitingFor: wait.ForLog("log"), }, Started: true, @@ -1266,7 +1266,7 @@ func TestContainerCustomPlatformImage(t *testing.T) { c, err := GenericContainer(ctx, GenericContainerRequest{ ProviderType: providerType, ContainerRequest: ContainerRequest{ - Image: "docker.io/redis:latest", + Image: "redis:latest", ImagePlatform: nonExistentPlatform, }, Started: false, @@ -1282,7 +1282,7 @@ func TestContainerCustomPlatformImage(t *testing.T) { c, err := GenericContainer(ctx, GenericContainerRequest{ ProviderType: providerType, ContainerRequest: ContainerRequest{ - Image: "docker.io/mysql:8.0.36", + Image: "mysql:8.0.36", ImagePlatform: "linux/amd64", }, Started: false, @@ -1817,7 +1817,7 @@ func TestContainerRunningCheckingStatusCode(t *testing.T) { func TestContainerWithUserID(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/alpine:latest", + Image: "alpine:latest", User: "60125", Cmd: []string{"sh", "-c", "id -u"}, WaitingFor: wait.ForExit(), @@ -1846,7 +1846,7 @@ func TestContainerWithUserID(t *testing.T) { func TestContainerWithNoUserID(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/alpine:latest", + Image: "alpine:latest", Cmd: []string{"sh", "-c", "id -u"}, WaitingFor: wait.ForExit(), } diff --git a/docs/features/image_name_substitution.md b/docs/features/image_name_substitution.md index 08e9e1d6a0..4272d35c1e 100644 --- a/docs/features/image_name_substitution.md +++ b/docs/features/image_name_substitution.md @@ -45,7 +45,7 @@ _Testcontainers for Go_ will automatically apply the prefix to every image that _Testcontainers for Go_ will not apply the prefix to: * non-Hub image names (e.g. where another registry is set) -* Docker Hub image names where the hub registry is explicitly part of the name (i.e. anything with a `docker.io` or `registry.hub.docker.com` host part) +* Docker Hub image names where the hub registry is explicitly part of the name (i.e. anything with a `registry.hub.docker.com` host part) ## Developing a custom function for transforming image names on the fly @@ -68,7 +68,7 @@ You can implement a custom image name substitutor by: * implementing the `ImageNameSubstitutor` interface, exposed by the `testcontainers` package. * configuring _Testcontainers for Go_ to use your custom implementation, defined at the `ContainerRequest` level. -The following is an example image substitutor implementation prepending the `docker.io/` prefix, used in the tests: +The following is an example image substitutor implementation prepending the `registry.hub.docker.com/library/` prefix, used in the tests: [Image Substitutor Interface](../../options.go) inside_block:imageSubstitutor diff --git a/docs/features/wait/exit.md b/docs/features/wait/exit.md index 3487cb2d21..bcb1aaca36 100644 --- a/docs/features/wait/exit.md +++ b/docs/features/wait/exit.md @@ -9,7 +9,7 @@ The exit wait strategy will check that the container is not in the running state ```golang req := ContainerRequest{ - Image: "docker.io/alpine:latest", + Image: "alpine:latest", WaitingFor: wait.ForExit(), } ``` diff --git a/docs/features/wait/health.md b/docs/features/wait/health.md index d4756f47bd..f724a11010 100644 --- a/docs/features/wait/health.md +++ b/docs/features/wait/health.md @@ -7,7 +7,7 @@ The health wait strategy will check that the container is in the healthy state a ```golang req := ContainerRequest{ - Image: "docker.io/alpine:latest", + Image: "alpine:latest", WaitingFor: wait.ForHealthCheck(), } ``` diff --git a/docs/features/wait/host_port.md b/docs/features/wait/host_port.md index 1b6090b584..10531e5e64 100644 --- a/docs/features/wait/host_port.md +++ b/docs/features/wait/host_port.md @@ -14,7 +14,7 @@ Variations on the HostPort wait strategy are supported, including: ```golang req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp"}, WaitingFor: wait.ForListeningPort("80/tcp"), } @@ -26,7 +26,7 @@ The wait strategy will use the lowest exposed port from the container configurat ```golang req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", WaitingFor: wait.ForExposedPort(), } ``` @@ -35,7 +35,7 @@ Said that, it could be the case that the container request included ports to be ```golang req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp", "9080/tcp"}, WaitingFor: wait.ForExposedPort(), } @@ -55,7 +55,7 @@ In this case, the `wait.ForExposedPort.SkipInternalCheck` can be used to skip th ```golang req := ContainerRequest{ - Image: "docker.io/nginx:alpine", + Image: "nginx:alpine", ExposedPorts: []string{"80/tcp", "9080/tcp"}, WaitingFor: wait.ForExposedPort().SkipInternalCheck(), } diff --git a/docs/features/wait/log.md b/docs/features/wait/log.md index 66c418b284..f1d40ff360 100644 --- a/docs/features/wait/log.md +++ b/docs/features/wait/log.md @@ -10,7 +10,7 @@ The Log wait strategy will check if a string occurs in the container logs for a ```golang req := ContainerRequest{ - Image: "docker.io/mysql:8.0.36", + Image: "mysql:8.0.36", ExposedPorts: []string{"3306/tcp", "33060/tcp"}, Env: map[string]string{ "MYSQL_ROOT_PASSWORD": "password", @@ -24,7 +24,7 @@ Using a regular expression: ```golang req := ContainerRequest{ - Image: "docker.io/mysql:8.0.36", + Image: "mysql:8.0.36", ExposedPorts: []string{"3306/tcp", "33060/tcp"}, Env: map[string]string{ "MYSQL_ROOT_PASSWORD": "password", diff --git a/docs/features/wait/multi.md b/docs/features/wait/multi.md index bfd053955b..d5f809d6c2 100644 --- a/docs/features/wait/multi.md +++ b/docs/features/wait/multi.md @@ -9,7 +9,7 @@ Available Options: ```golang req := ContainerRequest{ - Image: "docker.io/mysql:8.0.36", + Image: "mysql:8.0.36", ExposedPorts: []string{"3306/tcp", "33060/tcp"}, Env: map[string]string{ "MYSQL_ROOT_PASSWORD": "password", diff --git a/docs/modules/artemis.md b/docs/modules/artemis.md index 395f1b304b..da13e2178a 100644 --- a/docs/modules/artemis.md +++ b/docs/modules/artemis.md @@ -50,7 +50,7 @@ When starting the Artemis container, you can pass options in a variadic way to c #### Image If you need to set a different Artemis Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/apache/activemq-artemis:2.30.0")`. +E.g. `Run(context.Background(), "apache/activemq-artemis:2.30.0")`. {% include "../features/common_functional_options.md" %} diff --git a/docs/modules/consul.md b/docs/modules/consul.md index 813799e28a..b2b77921df 100644 --- a/docs/modules/consul.md +++ b/docs/modules/consul.md @@ -46,7 +46,7 @@ When starting the Consul container, you can pass options in a variadic way to co #### Image If you need to set a different Consul Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/hashicorp/consul:1.15")`. +E.g. `Run(context.Background(), "hashicorp/consul:1.15")`. {% include "../features/common_functional_options.md" %} diff --git a/docs/modules/couchbase.md b/docs/modules/couchbase.md index ac07889bfa..43b0c85007 100644 --- a/docs/modules/couchbase.md +++ b/docs/modules/couchbase.md @@ -73,7 +73,7 @@ When starting the Couchbase container, you can pass options in a variadic way to #### Image If you need to set a different Couchbase Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/couchbase:6.5.1")`. +E.g. `Run(context.Background(), "couchbase:6.5.1")`. You can find the Docker images that are currently tested in this module, for the Enterprise and Community editions, in the following list: diff --git a/docs/modules/index.md b/docs/modules/index.md index 629787fedf..8db41723fa 100644 --- a/docs/modules/index.md +++ b/docs/modules/index.md @@ -72,7 +72,7 @@ We have provided a command line tool to generate the scaffolding for the code of | Flag | Short | Type | Required | Description | |---------|-------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------| | --name | -n | string | Yes | Name of the module, use camel-case when needed. Only alphanumerical characters are allowed (leading character must be a letter). | -| --image | -i | string | Yes | Fully-qualified name of the Docker image to be used in the examples and tests (i.e. 'docker.io/org/project:tag') | +| --image | -i | string | Yes | Fully-qualified name of the Docker image to be used in the examples and tests (i.e. 'org/project:tag') | | --title | -t | string | No | A variant of the name supporting mixed casing (i.e. 'MongoDB'). Only alphanumerical characters are allowed (leading character must be a letter). | diff --git a/docs/modules/k3s.md b/docs/modules/k3s.md index 6ada392534..617c1d4ffe 100644 --- a/docs/modules/k3s.md +++ b/docs/modules/k3s.md @@ -52,7 +52,7 @@ When starting the K3s container, you can pass options in a variadic way to confi #### Image If you need to set a different K3s Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/rancher/k3s:v1.27.1-k3s1")`. +E.g. `Run(context.Background(), "rancher/k3s:v1.27.1-k3s1")`. {% include "../features/common_functional_options.md" %} diff --git a/docs/modules/neo4j.md b/docs/modules/neo4j.md index aadda970e1..0431df12a1 100644 --- a/docs/modules/neo4j.md +++ b/docs/modules/neo4j.md @@ -56,7 +56,7 @@ When starting the Neo4j container, you can pass options in a variadic way to con #### Image If you need to set a different Neo4j Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/neo4j:4.4")`. +E.g. `Run(context.Background(), "neo4j:4.4")`. By default, the container will use the following Docker image: diff --git a/docs/modules/postgres.md b/docs/modules/postgres.md index 82b1e04351..930de50c15 100644 --- a/docs/modules/postgres.md +++ b/docs/modules/postgres.md @@ -49,7 +49,7 @@ When starting the Postgres container, you can pass options in a variadic way to #### Image If you need to set a different Postgres Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/postgres:16-alpine")`. +E.g. `Run(context.Background(), "postgres:16-alpine")`. {% include "../features/common_functional_options.md" %} diff --git a/docs/modules/pulsar.md b/docs/modules/pulsar.md index d8c3db5735..99f93b2222 100644 --- a/docs/modules/pulsar.md +++ b/docs/modules/pulsar.md @@ -52,7 +52,7 @@ When starting the Pulsar container, you can pass options in a variadic way to co #### Image If you need to set a different Pulsar Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/apachepulsar/pulsar:2.10.2")`. +E.g. `Run(context.Background(), "apachepulsar/pulsar:2.10.2")`. {% include "../features/common_functional_options.md" %} diff --git a/docs/modules/redis.md b/docs/modules/redis.md index 51e111dfff..e6bbd90851 100644 --- a/docs/modules/redis.md +++ b/docs/modules/redis.md @@ -49,7 +49,7 @@ When starting the Redis container, you can pass options in a variadic way to con #### Image If you need to set a different Redis Docker image, you can set a valid Docker image as the second argument in the `Run` function. -E.g. `Run(context.Background(), "docker.io/redis:7")`. +E.g. `Run(context.Background(), "redis:7")`. {% include "../features/common_functional_options.md" %} diff --git a/docs/system_requirements/using_podman.md b/docs/system_requirements/using_podman.md index cf65792bbd..4143306901 100644 --- a/docs/system_requirements/using_podman.md +++ b/docs/system_requirements/using_podman.md @@ -27,7 +27,7 @@ func TestSomething(t *testing.T) { req := tc.GenericContainerRequest{ ProviderType: tc.ProviderPodman, ContainerRequest: tc.ContainerRequest{ - Image: "docker.io/nginx:alpine" + Image: "nginx:alpine" }, } diff --git a/image_substitutors_test.go b/image_substitutors_test.go index 4a41f31ce6..92b42e63b3 100644 --- a/image_substitutors_test.go +++ b/image_substitutors_test.go @@ -104,16 +104,16 @@ func TestPrependHubRegistrySubstitutor(t *testing.T) { } }) - t.Run("explicitly including docker.io", func(t *testing.T) { + t.Run("explicitly including registry.hub.docker.com/library", func(t *testing.T) { s := newPrependHubRegistry("my-registry") - img, err := s.Substitute("docker.io/foo:latest") + img, err := s.Substitute("registry.hub.docker.com/library/foo:latest") if err != nil { t.Fatal(err) } - if img != "docker.io/foo:latest" { - t.Errorf("expected docker.io/foo:latest, got %s", img) + if img != "registry.hub.docker.com/library/foo:latest" { + t.Errorf("expected registry.hub.docker.com/library/foo:latest, got %s", img) } }) diff --git a/lifecycle_test.go b/lifecycle_test.go index b1cff8dad8..0d7e9c7861 100644 --- a/lifecycle_test.go +++ b/lifecycle_test.go @@ -887,7 +887,7 @@ func TestPrintContainerLogsOnError(t *testing.T) { ctx := context.Background() req := ContainerRequest{ - Image: "docker.io/alpine", + Image: "alpine", Cmd: []string{"echo", "-n", "I am expecting this"}, WaitingFor: wait.ForLog("I was expecting that").WithStartupTimeout(5 * time.Second), } diff --git a/logconsumer_test.go b/logconsumer_test.go index 9f4b0b61f9..f16c2fc007 100644 --- a/logconsumer_test.go +++ b/logconsumer_test.go @@ -251,7 +251,7 @@ func TestContainerLogWithErrClosed(t *testing.T) { dind, err := GenericContainer(ctx, GenericContainerRequest{ Started: true, ContainerRequest: ContainerRequest{ - Image: "docker.io/docker:dind", + Image: "docker:dind", ExposedPorts: []string{"2375/tcp"}, Env: map[string]string{"DOCKER_TLS_CERTDIR": ""}, WaitingFor: wait.ForListeningPort("2375/tcp"), diff --git a/modulegen/main_test.go b/modulegen/main_test.go index eeb836a8a5..bbad5a5abb 100644 --- a/modulegen/main_test.go +++ b/modulegen/main_test.go @@ -187,7 +187,7 @@ func TestGenerateWrongModuleName(t *testing.T) { for _, test := range tests { module := context.TestcontainersModule{ Name: test.name, - Image: "docker.io/example/" + test.name + ":latest", + Image: "example/" + test.name + ":latest", } err = internal.GenerateFiles(tmpCtx, module) @@ -231,7 +231,7 @@ func TestGenerateWrongModuleTitle(t *testing.T) { module := context.TestcontainersModule{ Name: "foo", TitleName: test.title, - Image: "docker.io/example/foo:latest", + Image: "example/foo:latest", } err = internal.GenerateFiles(tmpCtx, module) @@ -266,7 +266,7 @@ func TestGenerate(t *testing.T) { Name: "foodb4tw", TitleName: "FooDB4TheWin", IsModule: false, - Image: "docker.io/example/foodb:latest", + Image: "example/foodb:latest", } moduleNameLower := module.Lower() @@ -322,7 +322,7 @@ func TestGenerateModule(t *testing.T) { Name: "foodb", TitleName: "FooDB", IsModule: true, - Image: "docker.io/example/foodb:latest", + Image: "example/foodb:latest", } moduleNameLower := module.Lower() diff --git a/modules/artemis/artemis.go b/modules/artemis/artemis.go index a8721ce189..e74b542cd7 100644 --- a/modules/artemis/artemis.go +++ b/modules/artemis/artemis.go @@ -81,7 +81,7 @@ func WithExtraArgs(args string) testcontainers.CustomizeRequestOption { // Deprecated: use Run instead. // RunContainer creates an instance of the Artemis container type. func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Container, error) { - return Run(ctx, "docker.io/apache/activemq-artemis:2.30.0-alpine", opts...) + return Run(ctx, "apache/activemq-artemis:2.30.0-alpine", opts...) } // Run creates an instance of the Artemis container type with a given image diff --git a/modules/artemis/artemis_test.go b/modules/artemis/artemis_test.go index 8396b562f5..70dcab9440 100644 --- a/modules/artemis/artemis_test.go +++ b/modules/artemis/artemis_test.go @@ -65,7 +65,7 @@ func TestArtemis(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - ctr, err := artemis.Run(ctx, "docker.io/apache/activemq-artemis:2.30.0-alpine", test.opts...) + ctr, err := artemis.Run(ctx, "apache/activemq-artemis:2.30.0-alpine", test.opts...) testcontainers.CleanupContainer(t, ctr) require.NoError(t, err) diff --git a/modules/artemis/examples_test.go b/modules/artemis/examples_test.go index 78f8c2d13d..04e973a013 100644 --- a/modules/artemis/examples_test.go +++ b/modules/artemis/examples_test.go @@ -16,7 +16,7 @@ func ExampleRun() { ctx := context.Background() artemisContainer, err := artemis.Run(ctx, - "docker.io/apache/activemq-artemis:2.30.0", + "apache/activemq-artemis:2.30.0", artemis.WithCredentials("test", "test"), ) defer func() { diff --git a/modules/compose/compose_api_test.go b/modules/compose/compose_api_test.go index e5f30a5257..e13c6ca937 100644 --- a/modules/compose/compose_api_test.go +++ b/modules/compose/compose_api_test.go @@ -440,7 +440,7 @@ func TestDockerComposeAPIWithStackReader(t *testing.T) { composeContent := ` services: api-nginx: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine environment: bar: ${bar} foo: ${foo} @@ -481,7 +481,7 @@ func TestDockerComposeAPIWithStackReaderAndComposeFile(t *testing.T) { composeContent := ` services: api-postgres: - image: docker.io/postgres:14 + image: postgres:14 environment: POSTGRES_PASSWORD: s3cr3t ` diff --git a/modules/compose/testdata/docker-compose-complex.yml b/modules/compose/testdata/docker-compose-complex.yml index fe0636dff2..d84f39ec16 100644 --- a/modules/compose/testdata/docker-compose-complex.yml +++ b/modules/compose/testdata/docker-compose-complex.yml @@ -1,10 +1,10 @@ services: {{ .ServiceType }}-nginx: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine ports: - "{{ .Port_0 }}:80" {{ .ServiceType }}-mysql: - image: docker.io/mysql:8.0.36 + image: mysql:8.0.36 environment: - MYSQL_DATABASE=db - MYSQL_ROOT_PASSWORD=my-secret-pw diff --git a/modules/compose/testdata/docker-compose-container-name.yml b/modules/compose/testdata/docker-compose-container-name.yml index c46ca68888..d36bf96c87 100644 --- a/modules/compose/testdata/docker-compose-container-name.yml +++ b/modules/compose/testdata/docker-compose-container-name.yml @@ -1,7 +1,7 @@ services: {{ .ServiceType }}-nginx: container_name: {{ .ServiceType }}-nginxy - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine environment: bar: ${bar} ports: diff --git a/modules/compose/testdata/docker-compose-no-exposed-ports.yml b/modules/compose/testdata/docker-compose-no-exposed-ports.yml index 3f487156c3..e59e1a6fe9 100644 --- a/modules/compose/testdata/docker-compose-no-exposed-ports.yml +++ b/modules/compose/testdata/docker-compose-no-exposed-ports.yml @@ -1,5 +1,5 @@ services: {{ .ServiceType }}-nginx: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine ports: - "80" diff --git a/modules/compose/testdata/docker-compose-override.yml b/modules/compose/testdata/docker-compose-override.yml index c8714256e0..6112c8d595 100644 --- a/modules/compose/testdata/docker-compose-override.yml +++ b/modules/compose/testdata/docker-compose-override.yml @@ -1,8 +1,8 @@ services: {{ .ServiceType }}-nginx: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine {{ .ServiceType }}-mysql: - image: docker.io/mysql:8.0.36 + image: mysql:8.0.36 environment: MYSQL_RANDOM_ROOT_PASSWORD: Y ports: diff --git a/modules/compose/testdata/docker-compose-postgres.yml b/modules/compose/testdata/docker-compose-postgres.yml index 9671a7bdb5..012c2e0fda 100644 --- a/modules/compose/testdata/docker-compose-postgres.yml +++ b/modules/compose/testdata/docker-compose-postgres.yml @@ -1,6 +1,6 @@ services: {{ .ServiceType }}-postgres: - image: docker.io/postgres:14 + image: postgres:14 environment: POSTGRES_PASSWORD: s3cr3t ports: diff --git a/modules/compose/testdata/docker-compose-profiles.yml b/modules/compose/testdata/docker-compose-profiles.yml index fdb92853e1..a58bf014d3 100644 --- a/modules/compose/testdata/docker-compose-profiles.yml +++ b/modules/compose/testdata/docker-compose-profiles.yml @@ -1,24 +1,24 @@ services: starts-always: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine ports: - ":80" # profiles: none defined, therefore always starts. only-dev: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine ports: - ":80" profiles: - dev dev-or-test: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine ports: - ":80" profiles: - dev - test only-prod: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine ports: - ":80" profiles: diff --git a/modules/compose/testdata/docker-compose-short-lifespan.yml b/modules/compose/testdata/docker-compose-short-lifespan.yml index 47fd1314bb..19486a792b 100644 --- a/modules/compose/testdata/docker-compose-short-lifespan.yml +++ b/modules/compose/testdata/docker-compose-short-lifespan.yml @@ -1,7 +1,7 @@ services: tzatziki: - image: docker.io/alpine:latest + image: alpine:latest command: "sleep 5" falafel: - image: docker.io/alpine:latest + image: alpine:latest command: "echo 'World is your canvas'" diff --git a/modules/compose/testdata/docker-compose-simple.yml b/modules/compose/testdata/docker-compose-simple.yml index ebf8a64b6f..a3aad440bc 100644 --- a/modules/compose/testdata/docker-compose-simple.yml +++ b/modules/compose/testdata/docker-compose-simple.yml @@ -1,6 +1,6 @@ services: {{ .ServiceType }}-nginx: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine environment: bar: ${bar} foo: ${foo} diff --git a/modules/compose/testdata/docker-compose-volume.yml b/modules/compose/testdata/docker-compose-volume.yml index f284a71452..9f904d41d9 100644 --- a/modules/compose/testdata/docker-compose-volume.yml +++ b/modules/compose/testdata/docker-compose-volume.yml @@ -1,6 +1,6 @@ services: {{ .ServiceType }}-nginx: - image: docker.io/nginx:stable-alpine + image: nginx:stable-alpine volumes: - type: volume source: mydata diff --git a/modules/compose/testdata/echoserver.Dockerfile b/modules/compose/testdata/echoserver.Dockerfile index 546489ffac..aaf835f35a 100644 --- a/modules/compose/testdata/echoserver.Dockerfile +++ b/modules/compose/testdata/echoserver.Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:1.13-alpine +FROM golang:1.13-alpine WORKDIR /app diff --git a/modules/consul/consul.go b/modules/consul/consul.go index c374938c32..0084786afb 100644 --- a/modules/consul/consul.go +++ b/modules/consul/consul.go @@ -15,7 +15,7 @@ const ( const ( // Deprecated: it will be removed in the next major version. - DefaultBaseImage = "docker.io/hashicorp/consul:1.15" + DefaultBaseImage = "hashicorp/consul:1.15" ) // ConsulContainer represents the Consul container type used in the module. @@ -65,7 +65,7 @@ func WithConfigFile(configPath string) testcontainers.CustomizeRequestOption { // Deprecated: use Run instead // RunContainer creates an instance of the Consul container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*ConsulContainer, error) { - return Run(ctx, "docker.io/hashicorp/consul:1.15", opts...) + return Run(ctx, "hashicorp/consul:1.15", opts...) } // Run creates an instance of the Consul container type diff --git a/modules/consul/consul_test.go b/modules/consul/consul_test.go index 79b626d359..6f359b7261 100644 --- a/modules/consul/consul_test.go +++ b/modules/consul/consul_test.go @@ -39,7 +39,7 @@ func TestConsul(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - ctr, err := consul.Run(ctx, "docker.io/hashicorp/consul:1.15", test.opts...) + ctr, err := consul.Run(ctx, "hashicorp/consul:1.15", test.opts...) testcontainers.CleanupContainer(t, ctr) require.NoError(t, err) diff --git a/modules/consul/examples_test.go b/modules/consul/examples_test.go index 32d323fe3d..d833575880 100644 --- a/modules/consul/examples_test.go +++ b/modules/consul/examples_test.go @@ -15,7 +15,7 @@ func ExampleRun() { // runConsulContainer { ctx := context.Background() - consulContainer, err := consul.Run(ctx, "docker.io/hashicorp/consul:1.15") + consulContainer, err := consul.Run(ctx, "hashicorp/consul:1.15") defer func() { if err := testcontainers.TerminateContainer(consulContainer); err != nil { log.Printf("failed to terminate container: %s", err) @@ -43,7 +43,7 @@ func ExampleRun_connect() { // connectConsul { ctx := context.Background() - consulContainer, err := consul.Run(ctx, "docker.io/hashicorp/consul:1.15") + consulContainer, err := consul.Run(ctx, "hashicorp/consul:1.15") defer func() { if err := testcontainers.TerminateContainer(consulContainer); err != nil { log.Printf("failed to terminate container: %s", err) diff --git a/modules/k3s/k3s.go b/modules/k3s/k3s.go index 509719bd64..8a3625eb65 100644 --- a/modules/k3s/k3s.go +++ b/modules/k3s/k3s.go @@ -50,7 +50,7 @@ func WithManifest(manifestPath string) testcontainers.CustomizeRequestOption { // Deprecated: use Run instead // RunContainer creates an instance of the K3s container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*K3sContainer, error) { - return Run(ctx, "docker.io/rancher/k3s:v1.27.1-k3s1", opts...) + return Run(ctx, "rancher/k3s:v1.27.1-k3s1", opts...) } // Run creates an instance of the K3s container type diff --git a/modules/k3s/k3s_example_test.go b/modules/k3s/k3s_example_test.go index ef2ca36538..cd1c7afc7e 100644 --- a/modules/k3s/k3s_example_test.go +++ b/modules/k3s/k3s_example_test.go @@ -17,7 +17,7 @@ func ExampleRun() { // runK3sContainer { ctx := context.Background() - k3sContainer, err := k3s.Run(ctx, "docker.io/rancher/k3s:v1.27.1-k3s1") + k3sContainer, err := k3s.Run(ctx, "rancher/k3s:v1.27.1-k3s1") defer func() { if err := testcontainers.TerminateContainer(k3sContainer); err != nil { log.Printf("failed to terminate container: %s", err) diff --git a/modules/k3s/k3s_test.go b/modules/k3s/k3s_test.go index f3970a25da..d89121dde3 100644 --- a/modules/k3s/k3s_test.go +++ b/modules/k3s/k3s_test.go @@ -23,7 +23,7 @@ func Test_LoadImages(t *testing.T) { ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(3*time.Minute)) defer cancel() - k3sContainer, err := k3s.Run(ctx, "docker.io/rancher/k3s:v1.27.1-k3s1") + k3sContainer, err := k3s.Run(ctx, "rancher/k3s:v1.27.1-k3s1") testcontainers.CleanupContainer(t, k3sContainer) require.NoError(t, err) @@ -105,7 +105,7 @@ func getTestPodState(ctx context.Context, k8s *kubernetes.Clientset) (corev1.Con func Test_APIServerReady(t *testing.T) { ctx := context.Background() - k3sContainer, err := k3s.Run(ctx, "docker.io/rancher/k3s:v1.27.1-k3s1") + k3sContainer, err := k3s.Run(ctx, "rancher/k3s:v1.27.1-k3s1") testcontainers.CleanupContainer(t, k3sContainer) require.NoError(t, err) @@ -144,7 +144,7 @@ func Test_WithManifestOption(t *testing.T) { ctx := context.Background() k3sContainer, err := k3s.Run(ctx, - "docker.io/rancher/k3s:v1.27.1-k3s1", + "rancher/k3s:v1.27.1-k3s1", k3s.WithManifest("nginx-manifest.yaml"), testcontainers.WithWaitStrategy(wait.ForExec([]string{"kubectl", "wait", "pod", "nginx", "--for=condition=Ready"})), ) diff --git a/modules/minio/minio.go b/modules/minio/minio.go index 6907b1372b..88c4f365d5 100644 --- a/modules/minio/minio.go +++ b/modules/minio/minio.go @@ -59,7 +59,7 @@ func (c *MinioContainer) ConnectionString(ctx context.Context) (string, error) { // Deprecated: use Run instead // RunContainer creates an instance of the Minio container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*MinioContainer, error) { - return Run(ctx, "docker.io/minio/minio:RELEASE.2024-01-16T16-07-38Z", opts...) + return Run(ctx, "minio/minio:RELEASE.2024-01-16T16-07-38Z", opts...) } // Run creates an instance of the Minio container type diff --git a/modules/neo4j/examples_test.go b/modules/neo4j/examples_test.go index 6e8c42936a..51b11bf49a 100644 --- a/modules/neo4j/examples_test.go +++ b/modules/neo4j/examples_test.go @@ -16,7 +16,7 @@ func ExampleRun() { testPassword := "letmein!" neo4jContainer, err := neo4j.Run(ctx, - "docker.io/neo4j:4.4", + "neo4j:4.4", neo4j.WithAdminPassword(testPassword), neo4j.WithLabsPlugin(neo4j.Apoc), neo4j.WithNeo4jSetting("dbms.tx_log.rotation.size", "42M"), diff --git a/modules/neo4j/neo4j_test.go b/modules/neo4j/neo4j_test.go index d036fb8128..9d41e4afe5 100644 --- a/modules/neo4j/neo4j_test.go +++ b/modules/neo4j/neo4j_test.go @@ -63,8 +63,8 @@ func TestNeo4jWithEnterpriseLicense(t *testing.T) { ctx := context.Background() images := map[string]string{ - "StandardEdition": "docker.io/neo4j:4.4", - "EnterpriseEdition": "docker.io/neo4j:4.4-enterprise", + "StandardEdition": "neo4j:4.4", + "EnterpriseEdition": "neo4j:4.4-enterprise", } for edition, img := range images { diff --git a/modules/postgres/examples_test.go b/modules/postgres/examples_test.go index 8b7f562ea9..1f5b0e1c86 100644 --- a/modules/postgres/examples_test.go +++ b/modules/postgres/examples_test.go @@ -21,7 +21,7 @@ func ExampleRun() { dbPassword := "password" postgresContainer, err := postgres.Run(ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithInitScripts(filepath.Join("testdata", "init-user-db.sh")), postgres.WithConfigFile(filepath.Join("testdata", "my-postgres.conf")), postgres.WithDatabase(dbName), diff --git a/modules/postgres/postgres.go b/modules/postgres/postgres.go index ac51721f82..8bd32a49b7 100644 --- a/modules/postgres/postgres.go +++ b/modules/postgres/postgres.go @@ -136,7 +136,7 @@ func WithUsername(user string) testcontainers.CustomizeRequestOption { // Deprecated: use Run instead // RunContainer creates an instance of the Postgres container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*PostgresContainer, error) { - return Run(ctx, "docker.io/postgres:16-alpine", opts...) + return Run(ctx, "postgres:16-alpine", opts...) } // Run creates an instance of the Postgres container type diff --git a/modules/postgres/postgres_test.go b/modules/postgres/postgres_test.go index 7167da5c51..05b3f8110e 100644 --- a/modules/postgres/postgres_test.go +++ b/modules/postgres/postgres_test.go @@ -34,24 +34,24 @@ func TestPostgres(t *testing.T) { }{ { name: "Postgres", - image: "docker.io/postgres:15.2-alpine", + image: "postgres:15.2-alpine", }, { name: "Timescale", // timescale { - image: "docker.io/timescale/timescaledb:2.1.0-pg11", + image: "timescale/timescaledb:2.1.0-pg11", // } }, { name: "Postgis", // postgis { - image: "docker.io/postgis/postgis:12-3.0", + image: "postgis/postgis:12-3.0", // } }, { name: "Pgvector", // pgvector { - image: "docker.io/pgvector/pgvector:pg16", + image: "pgvector/pgvector:pg16", // } }, } @@ -112,7 +112,7 @@ func TestContainerWithWaitForSQL(t *testing.T) { t.Run("default query", func(t *testing.T) { ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), @@ -125,7 +125,7 @@ func TestContainerWithWaitForSQL(t *testing.T) { t.Run("custom query", func(t *testing.T) { ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), @@ -138,7 +138,7 @@ func TestContainerWithWaitForSQL(t *testing.T) { t.Run("custom bad query", func(t *testing.T) { ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), @@ -153,7 +153,7 @@ func TestWithConfigFile(t *testing.T) { ctx := context.Background() ctr, err := postgres.Run(ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithConfigFile(filepath.Join("testdata", "my-postgres.conf")), postgres.WithDatabase(dbname), postgres.WithUsername(user), @@ -177,7 +177,7 @@ func TestWithInitScript(t *testing.T) { ctx := context.Background() ctr, err := postgres.Run(ctx, - "docker.io/postgres:15.2-alpine", + "postgres:15.2-alpine", postgres.WithInitScripts(filepath.Join("testdata", "init-user-db.sh")), postgres.WithDatabase(dbname), postgres.WithUsername(user), @@ -228,7 +228,7 @@ func TestSnapshot(t *testing.T) { // 1. Start the postgres ctr and run any migrations on it ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), @@ -303,7 +303,7 @@ func TestSnapshotWithOverrides(t *testing.T) { ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), @@ -349,7 +349,7 @@ func TestSnapshotDuplicate(t *testing.T) { ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), @@ -375,7 +375,7 @@ func TestSnapshotWithDockerExecFallback(t *testing.T) { // 1. Start the postgres container and run any migrations on it ctr, err := postgres.Run( ctx, - "docker.io/postgres:16-alpine", + "postgres:16-alpine", postgres.WithDatabase(dbname), postgres.WithUsername(user), postgres.WithPassword(password), diff --git a/modules/pulsar/examples_test.go b/modules/pulsar/examples_test.go index ad871f1494..9561914207 100644 --- a/modules/pulsar/examples_test.go +++ b/modules/pulsar/examples_test.go @@ -13,7 +13,7 @@ func ExampleRun() { // runPulsarContainer { ctx := context.Background() - pulsarContainer, err := pulsar.Run(ctx, "docker.io/apachepulsar/pulsar:2.10.2") + pulsarContainer, err := pulsar.Run(ctx, "apachepulsar/pulsar:2.10.2") defer func() { if err := testcontainers.TerminateContainer(pulsarContainer); err != nil { log.Printf("failed to terminate container: %s", err) diff --git a/modules/pulsar/pulsar.go b/modules/pulsar/pulsar.go index 26c57b5742..be9ea10925 100644 --- a/modules/pulsar/pulsar.go +++ b/modules/pulsar/pulsar.go @@ -132,12 +132,12 @@ func WithTransactions() testcontainers.CustomizeRequestOption { // Deprecated: use Run instead // RunContainer creates an instance of the Pulsar container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Container, error) { - return Run(ctx, "docker.io/apachepulsar/pulsar:2.10.2", opts...) + return Run(ctx, "apachepulsar/pulsar:2.10.2", opts...) } // Run creates an instance of the Pulsar container type, being possible to pass a custom request and options // The created container will use the following defaults: -// - image: docker.io/apachepulsar/pulsar:2.10.2 +// - image: apachepulsar/pulsar:2.10.2 // - exposed ports: 6650/tcp, 8080/tcp // - waiting strategy: wait for all the following strategies: // - the Pulsar admin API ("/admin/v2/clusters") to be ready on port 8080/tcp and return the response `["standalone"]` diff --git a/modules/pulsar/pulsar_test.go b/modules/pulsar/pulsar_test.go index cd04284913..8cea6a4119 100644 --- a/modules/pulsar/pulsar_test.go +++ b/modules/pulsar/pulsar_test.go @@ -98,7 +98,7 @@ func TestPulsar(t *testing.T) { t.Run(tt.name, func(t *testing.T) { c, err := testcontainerspulsar.Run( ctx, - "docker.io/apachepulsar/pulsar:2.10.2", + "apachepulsar/pulsar:2.10.2", tt.opts..., ) testcontainers.CleanupContainer(t, c) diff --git a/modules/redis/examples_test.go b/modules/redis/examples_test.go index e5e83a01a1..86be00be85 100644 --- a/modules/redis/examples_test.go +++ b/modules/redis/examples_test.go @@ -15,7 +15,7 @@ func ExampleRun() { ctx := context.Background() redisContainer, err := redis.Run(ctx, - "docker.io/redis:7", + "redis:7", redis.WithSnapshotting(10, 1), redis.WithLogLevel(redis.LogLevelVerbose), redis.WithConfigFile(filepath.Join("testdata", "redis7.conf")), diff --git a/modules/redis/redis.go b/modules/redis/redis.go index df75ad7311..d834a6c46d 100644 --- a/modules/redis/redis.go +++ b/modules/redis/redis.go @@ -46,7 +46,7 @@ func (c *RedisContainer) ConnectionString(ctx context.Context) (string, error) { // Deprecated: use Run instead // RunContainer creates an instance of the Redis container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*RedisContainer, error) { - return Run(ctx, "docker.io/redis:7", opts...) + return Run(ctx, "redis:7", opts...) } // Run creates an instance of the Redis container type diff --git a/modules/redis/redis_test.go b/modules/redis/redis_test.go index 4a872a0a87..58d1c14c9c 100644 --- a/modules/redis/redis_test.go +++ b/modules/redis/redis_test.go @@ -18,7 +18,7 @@ import ( func TestIntegrationSetGet(t *testing.T) { ctx := context.Background() - redisContainer, err := tcredis.Run(ctx, "docker.io/redis:7") + redisContainer, err := tcredis.Run(ctx, "redis:7") testcontainers.CleanupContainer(t, redisContainer) require.NoError(t, err) @@ -28,7 +28,7 @@ func TestIntegrationSetGet(t *testing.T) { func TestRedisWithConfigFile(t *testing.T) { ctx := context.Background() - redisContainer, err := tcredis.Run(ctx, "docker.io/redis:7", tcredis.WithConfigFile(filepath.Join("testdata", "redis7.conf"))) + redisContainer, err := tcredis.Run(ctx, "redis:7", tcredis.WithConfigFile(filepath.Join("testdata", "redis7.conf"))) testcontainers.CleanupContainer(t, redisContainer) require.NoError(t, err) @@ -44,22 +44,22 @@ func TestRedisWithImage(t *testing.T) { }{ { name: "Redis6", - image: "docker.io/redis:6", + image: "redis:6", }, { name: "Redis7", - image: "docker.io/redis:7", + image: "redis:7", }, { name: "Redis Stack", // redisStackImage { - image: "docker.io/redis/redis-stack:latest", + image: "redis/redis-stack:latest", // } }, { name: "Redis Stack Server", // redisStackServerImage { - image: "docker.io/redis/redis-stack-server:latest", + image: "redis/redis-stack-server:latest", // } }, } @@ -78,7 +78,7 @@ func TestRedisWithImage(t *testing.T) { func TestRedisWithLogLevel(t *testing.T) { ctx := context.Background() - redisContainer, err := tcredis.Run(ctx, "docker.io/redis:7", tcredis.WithLogLevel(tcredis.LogLevelVerbose)) + redisContainer, err := tcredis.Run(ctx, "redis:7", tcredis.WithLogLevel(tcredis.LogLevelVerbose)) testcontainers.CleanupContainer(t, redisContainer) require.NoError(t, err) @@ -88,7 +88,7 @@ func TestRedisWithLogLevel(t *testing.T) { func TestRedisWithSnapshotting(t *testing.T) { ctx := context.Background() - redisContainer, err := tcredis.Run(ctx, "docker.io/redis:7", tcredis.WithSnapshotting(10, 1)) + redisContainer, err := tcredis.Run(ctx, "redis:7", tcredis.WithSnapshotting(10, 1)) testcontainers.CleanupContainer(t, redisContainer) require.NoError(t, err) diff --git a/modules/redis/testdata/Dockerfile b/modules/redis/testdata/Dockerfile index 7157611a13..14cfaf1e23 100644 --- a/modules/redis/testdata/Dockerfile +++ b/modules/redis/testdata/Dockerfile @@ -1 +1 @@ -FROM docker.io/redis:5.0-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c +FROM redis:5.0-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c diff --git a/modules/valkey/examples_test.go b/modules/valkey/examples_test.go index 7e1d261850..c700e8d3f3 100644 --- a/modules/valkey/examples_test.go +++ b/modules/valkey/examples_test.go @@ -15,7 +15,7 @@ func ExampleRun() { ctx := context.Background() valkeyContainer, err := valkey.Run(ctx, - "docker.io/valkey/valkey:7.2.5", + "valkey/valkey:7.2.5", valkey.WithSnapshotting(10, 1), valkey.WithLogLevel(valkey.LogLevelVerbose), valkey.WithConfigFile(filepath.Join("testdata", "valkey7.conf")), diff --git a/modules/valkey/valkey.go b/modules/valkey/valkey.go index 00f4e91186..e8da1ed0e2 100644 --- a/modules/valkey/valkey.go +++ b/modules/valkey/valkey.go @@ -48,7 +48,7 @@ func (c *ValkeyContainer) ConnectionString(ctx context.Context) (string, error) // Deprecated: use Run instead // RunContainer creates an instance of the Valkey container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*ValkeyContainer, error) { - return Run(ctx, "docker.io/valkey/valkey:7.2.5", opts...) + return Run(ctx, "valkey/valkey:7.2.5", opts...) } // Run creates an instance of the Valkey container type diff --git a/modules/valkey/valkey_test.go b/modules/valkey/valkey_test.go index 484c75dabe..26e2ea93b8 100644 --- a/modules/valkey/valkey_test.go +++ b/modules/valkey/valkey_test.go @@ -18,7 +18,7 @@ import ( func TestIntegrationSetGet(t *testing.T) { ctx := context.Background() - valkeyContainer, err := tcvalkey.Run(ctx, "docker.io/valkey/valkey:7.2.5") + valkeyContainer, err := tcvalkey.Run(ctx, "valkey/valkey:7.2.5") testcontainers.CleanupContainer(t, valkeyContainer) require.NoError(t, err) @@ -28,7 +28,7 @@ func TestIntegrationSetGet(t *testing.T) { func TestValkeyWithConfigFile(t *testing.T) { ctx := context.Background() - valkeyContainer, err := tcvalkey.Run(ctx, "docker.io/valkey/valkey:7.2.5", tcvalkey.WithConfigFile(filepath.Join("testdata", "valkey7.conf"))) + valkeyContainer, err := tcvalkey.Run(ctx, "valkey/valkey:7.2.5", tcvalkey.WithConfigFile(filepath.Join("testdata", "valkey7.conf"))) testcontainers.CleanupContainer(t, valkeyContainer) require.NoError(t, err) @@ -45,7 +45,7 @@ func TestValkeyWithImage(t *testing.T) { // There is only one release of Valkey at the time of writing { name: "Valkey7.2.5", - image: "docker.io/valkey/valkey:7.2.5", + image: "valkey/valkey:7.2.5", }, } @@ -63,7 +63,7 @@ func TestValkeyWithImage(t *testing.T) { func TestValkeyWithLogLevel(t *testing.T) { ctx := context.Background() - valkeyContainer, err := tcvalkey.Run(ctx, "docker.io/valkey/valkey:7.2.5", tcvalkey.WithLogLevel(tcvalkey.LogLevelVerbose)) + valkeyContainer, err := tcvalkey.Run(ctx, "valkey/valkey:7.2.5", tcvalkey.WithLogLevel(tcvalkey.LogLevelVerbose)) testcontainers.CleanupContainer(t, valkeyContainer) require.NoError(t, err) @@ -73,7 +73,7 @@ func TestValkeyWithLogLevel(t *testing.T) { func TestValkeyWithSnapshotting(t *testing.T) { ctx := context.Background() - valkeyContainer, err := tcvalkey.Run(ctx, "docker.io/valkey/valkey:7.2.5", tcvalkey.WithSnapshotting(10, 1)) + valkeyContainer, err := tcvalkey.Run(ctx, "valkey/valkey:7.2.5", tcvalkey.WithSnapshotting(10, 1)) testcontainers.CleanupContainer(t, valkeyContainer) require.NoError(t, err) diff --git a/network/network_test.go b/network/network_test.go index 5cee817ecc..bbe5d45c7c 100644 --- a/network/network_test.go +++ b/network/network_test.go @@ -16,7 +16,7 @@ import ( ) const ( - nginxAlpineImage = "docker.io/nginx:alpine" + nginxAlpineImage = "nginx:alpine" nginxDefaultPort = "80/tcp" ) @@ -37,7 +37,7 @@ func TestNew(t *testing.T) { nginxC, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "nginx:alpine", + Image: nginxAlpineImage, ExposedPorts: []string{ "80/tcp", }, @@ -275,7 +275,7 @@ func TestNew_withOptions(t *testing.T) { nginx, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ ContainerRequest: testcontainers.ContainerRequest{ - Image: "nginx:alpine", + Image: nginxAlpineImage, ExposedPorts: []string{ "80/tcp", }, diff --git a/options.go b/options.go index 2849b15667..4eb39058c8 100644 --- a/options.go +++ b/options.go @@ -186,7 +186,7 @@ func (p prependHubRegistry) Description() string { // - if the prefix is empty, the image is returned as is. // - if the image is a non-hub image (e.g. where another registry is set), the image is returned as is. // - if the image is a Docker Hub image where the hub registry is explicitly part of the name -// (i.e. anything with a docker.io or registry.hub.docker.com host part), the image is returned as is. +// (i.e. anything with a registry.hub.docker.com host part), the image is returned as is. func (p prependHubRegistry) Substitute(image string) (string, error) { registry := core.ExtractRegistry(image, "") diff --git a/scripts/bump-reaper.sh b/scripts/bump-reaper.sh index 34d17ce463..86af6b31c0 100755 --- a/scripts/bump-reaper.sh +++ b/scripts/bump-reaper.sh @@ -5,11 +5,11 @@ # dry-run mode, which will print the commands that would be executed, without actually # executing them. # -# Usage: ./scripts/bump-reaper.sh "docker.io/testcontainers/ryuk:1.2.3" +# Usage: ./scripts/bump-reaper.sh "testcontainers/ryuk:1.2.3" # # It's possible to run the script without dry-run mode actually executing the commands. # -# Usage: DRY_RUN="false" ./scripts/bump-reaper.sh "docker.io/testcontainers/ryuk:1.2.3" +# Usage: DRY_RUN="false" ./scripts/bump-reaper.sh "testcontainers/ryuk:1.2.3" readonly CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" readonly DRY_RUN="${DRY_RUN:-true}" diff --git a/scripts/release.sh b/scripts/release.sh index 6709c5c358..b675cb51e2 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -13,7 +13,7 @@ # Usage: DRY_RUN="false" ./scripts/release.sh readonly BUMP_TYPE="${BUMP_TYPE:-minor}" -readonly DOCKER_IMAGE_SEMVER="docker.io/mdelapenya/semver-tool:3.4.0" +readonly DOCKER_IMAGE_SEMVER="mdelapenya/semver-tool:3.4.0" readonly DRY_RUN="${DRY_RUN:-true}" readonly CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" readonly ROOT_DIR="$(dirname "$CURRENT_DIR")" diff --git a/testdata/Dockerfile b/testdata/Dockerfile index 7157611a13..14cfaf1e23 100644 --- a/testdata/Dockerfile +++ b/testdata/Dockerfile @@ -1 +1 @@ -FROM docker.io/redis:5.0-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c +FROM redis:5.0-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c diff --git a/testdata/args.Dockerfile b/testdata/args.Dockerfile index 984ef51eee..0260639719 100644 --- a/testdata/args.Dockerfile +++ b/testdata/args.Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:1.13-alpine +FROM golang:1.13-alpine ARG FOO diff --git a/testdata/buildlog.Dockerfile b/testdata/buildlog.Dockerfile index 0a9bc82c98..67fd379018 100644 --- a/testdata/buildlog.Dockerfile +++ b/testdata/buildlog.Dockerfile @@ -1 +1 @@ -FROM docker.io/alpine +FROM alpine diff --git a/testdata/echo.Dockerfile b/testdata/echo.Dockerfile index 10ab9febf4..36951e1aa6 100644 --- a/testdata/echo.Dockerfile +++ b/testdata/echo.Dockerfile @@ -1,3 +1,3 @@ -FROM docker.io/alpine +FROM alpine CMD ["echo", "this is from the echo test Dockerfile"] \ No newline at end of file diff --git a/testdata/echoserver.Dockerfile b/testdata/echoserver.Dockerfile index 546489ffac..aaf835f35a 100644 --- a/testdata/echoserver.Dockerfile +++ b/testdata/echoserver.Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:1.13-alpine +FROM golang:1.13-alpine WORKDIR /app diff --git a/testdata/error.Dockerfile b/testdata/error.Dockerfile index 1284e7285f..5d31293182 100644 --- a/testdata/error.Dockerfile +++ b/testdata/error.Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/alpine +FROM alpine RUN exit 1 diff --git a/testdata/target.Dockerfile b/testdata/target.Dockerfile index 996a83552f..f6a20273c7 100644 --- a/testdata/target.Dockerfile +++ b/testdata/target.Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/alpine AS target0 +FROM alpine AS target0 CMD ["echo", "target0"] FROM target0 AS target1 diff --git a/testhelpers_test.go b/testhelpers_test.go index 4f268a8aee..8d7587c17c 100644 --- a/testhelpers_test.go +++ b/testhelpers_test.go @@ -1,6 +1,6 @@ package testcontainers_test const ( - nginxAlpineImage = "docker.io/nginx:alpine" + nginxAlpineImage = "nginx:alpine" nginxDefaultPort = "80/tcp" ) diff --git a/wait/exec_test.go b/wait/exec_test.go index 8a82fb0211..4d2d97c51d 100644 --- a/wait/exec_test.go +++ b/wait/exec_test.go @@ -192,7 +192,7 @@ func TestExecStrategyWaitUntilReady_withExitCode(t *testing.T) { func TestExecStrategyWaitUntilReady_CustomResponseMatcher(t *testing.T) { // waitForExecExitCodeResponse { dockerReq := testcontainers.ContainerRequest{ - Image: "docker.io/nginx:latest", + Image: "nginx:latest", WaitingFor: wait.ForExec([]string{"echo", "hello world!"}). WithStartupTimeout(time.Second * 10). WithExitCodeMatcher(func(exitCode int) bool { diff --git a/wait/file_test.go b/wait/file_test.go index a25d8aa65f..22133ba349 100644 --- a/wait/file_test.go +++ b/wait/file_test.go @@ -79,7 +79,7 @@ func TestFileStrategyWaitUntilReady_WithMatcher(t *testing.T) { // waitForFileWithMatcher { var out bytes.Buffer dockerReq := testcontainers.ContainerRequest{ - Image: "docker.io/nginx:latest", + Image: "nginx:latest", WaitingFor: wait.ForFile("/etc/nginx/nginx.conf"). WithStartupTimeout(time.Second * 10). WithPollInterval(time.Second).