Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Docker Image Push throws "docker: invalid reference format" #265

Open
Aaronontheweb opened this issue Apr 14, 2022 · 1 comment
Open

Comments

@Aaronontheweb
Copy link
Member

Due to this line:

tags.Add($"{DockerRegistryUrl}/{tagVersion}");

Should be

tags.Add($"{DockerRegistryUrl}/{tagVersion}");
@Aaronontheweb
Copy link
Member Author

This is also a bug - bad name format for remote images:

 Target PushImage => _ => _
        .Description("Push image to docker registry")
        //.DependsOn(DockerLogin)
        .Executes(() =>
        {
            var version = ReleaseNotes.Version;
            var tagVersion = $"{version.Version.Major}.{version.Version.Minor}.{version.Version.Build}";
            var dockfiles = GetDockerProjects();
            foreach (var dockfile in dockfiles)
            {
                var image = $"{Directory.GetParent(dockfile).Name}".ToLower();
                var settings = new DockerImagePushSettings()
                    .SetName(string.IsNullOrWhiteSpace(DockerRegistryUrl) ? $"{image}:{tagVersion}" : $"{DockerRegistryUrl}/{image}:{tagVersion}");
                DockerTasks.DockerImagePush(settings);
            }
        });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant