0

I am trying to use gradle SpringBoot plugin version 2.4.2 in a project and build a docker image using bootBuildImage task. when i try o build docker image with a tag that containes slash the build will fail because the slash is not allowed in the tag i guess.

Her is a snipt of the customized gradle bootBuildImage in my project gradle file:

bootBuildImage { imageName = "hello-world:${art_contextUrl}/docker-repo" publish = false docker { publishRegistry { username = "${art_user}" password = "${art_password}" url = "${art_contextUrl}/docker-repo" } } 

}

The tag is consisted of context url of repository / repository. But the task will fail. If i use simple tag lik 0.0.1 the task will complite and a docker image will be created.

How do I tag the image correctly without using docker tag command, i mean just taging from the bootBuildImage task

1 Answer 1

2

From the documentation:

A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.

So no, you can't use slashes in a tag.

Sign up to request clarification or add additional context in comments.

1 Comment

This is correct. If you try to use that tag with docker tag you will get an error like is not a valid repository/tag: invalid reference format. Spring Boot attempts to enforce Docker image name rules.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.