TeamCity build configuration not using private docker feed

Completed

Hi,

I try to run a docker build on my TeamCity server. I configured a private docker feed to store the images which are built. This is the configuration I use:

import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.dockerSupport
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.PowerShellStep
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.dockerCommand
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.powerShell
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs

version = "2020.2"

project {

buildType(Build)
}

object Build : BuildType({
name = "Build"

buildNumberPattern = "%Major%.%Minor%.%Fix%.%build.counter%"

params {
param("Fix", "0")
param("Major", "1")
param("Minor", "0")
}

vcs {
root(DslContext.settingsRoot)

cleanCheckout = true
}

steps {

dockerCommand {
name = "Build Frontend"
commandType = build {
source = file {
path = "src/Frontend/Dockerfile"
}
contextDir = "src"
namesAndTags = "dummy.frontend:%build.number%"
commandArgs = "--pull"
}
}
dockerCommand {
name = "Push Frontend"
commandType = push {
namesAndTags = "dummy.frontend:%build.number%"
removeImageAfterPush = false
}
}
}
triggers {
vcs {
}
}

features {
dockerSupport {
loginToRegistry = on {
dockerRegistryId = "PROJECT_EXT_2"
}
}
}
})         

 

Unfortunately, the build is not using the private feed. I set up the feed under the project settings connections and the test there is successful. I also added the build feature. The log is as following:

Step 3/15: Push Frontend (Docker) 1s
22:40:46  Starting: cmd /c "docker push dummy.frontend:1.0.0.41"

I don't know why it always tries to push to docker.io as I NEVER want to use it to push to. 

Why is the configuration not using the private docker feed? Can I prevent the build from using docker.io in general (blacklist it)?

Best regards

0
1 comment

Figured it out. I head to prefix like followed:

registry/frontend:%build.number%

0

Please sign in to leave a comment.