You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual behavior
Using variable UPSTREAM_CLIENT_TYPE: "docker" in gitlab-ci.yaml in Docker-in-docker mode, kaniko does not send the expected user agent with the specified header or appended. What I see in nginx logs os that the User-agent is '"Go-http-client/2.0"'.
Expected behavior
I expect to see User-Agent to be custom defined with the "docker" value or it appended after the default user-agent used.
Additional Information
I use Nexus registry behind nginx reverse proxy. Since the tag is also the hostname of the proxy. I use below if statement in nginx to proxy docker client requests.
if ($$http_user_agent ~* docker) {
proxy_pass $$upstream_docker;
}
Seems like Kaniko uses normal http requests and I am trying to change the user-agent to a custom one, for it to work. Kaniko is running in Docker-in-docker mode inside gitlab runner. I have not seen any notes on how to do it but searching through the code I found this and unsure if it's intended to be used or if it even works:
I did also try adding it into the config.json inside kaniko but it did not work
: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}},\"HttpHeaders\":{\"User-Agent\":\"Docker-Client/custom-nginx-dind-docker\"}}" > /kaniko/.docker/config.json
I am using the latest gcr.io/kaniko-project/executor:debug debug image v1.23.2.
Kaniko is run with - /kaniko/executor --cache=true --context $CONTEXT --dockerfile $DOCKERFILE_PATH --destination $DOCKER_TAG
The setup is running in docker swarm.
Description
Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
- [ x]
Please check if this error is seen when you use --cache flag
- [x ]
Please check if your dockerfile is a multistage dockerfile
The text was updated successfully, but these errors were encountered:
Actual behavior
Using variable UPSTREAM_CLIENT_TYPE: "docker" in gitlab-ci.yaml in Docker-in-docker mode, kaniko does not send the expected user agent with the specified header or appended. What I see in nginx logs os that the User-agent is '"Go-http-client/2.0"'.
Expected behavior
I expect to see User-Agent to be custom defined with the "docker" value or it appended after the default user-agent used.
Additional Information
I use Nexus registry behind nginx reverse proxy. Since the tag is also the hostname of the proxy. I use below if statement in nginx to proxy docker client requests.
Seems like Kaniko uses normal http requests and I am trying to change the user-agent to a custom one, for it to work. Kaniko is running in Docker-in-docker mode inside gitlab runner. I have not seen any notes on how to do it but searching through the code I found this and unsure if it's intended to be used or if it even works:
kaniko/pkg/executor/push.go
Line 61 in e328007
I did also try adding it into the config.json inside kaniko but it did not work
:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}},\"HttpHeaders\":{\"User-Agent\":\"Docker-Client/custom-nginx-dind-docker\"}}" > /kaniko/.docker/config.json
I am using the latest gcr.io/kaniko-project/executor:debug debug image v1.23.2.
Kaniko is run with
- /kaniko/executor --cache=true --context $CONTEXT --dockerfile $DOCKERFILE_PATH --destination $DOCKER_TAG
The setup is running in docker swarm.
--cache
flagThe text was updated successfully, but these errors were encountered: