Having an Artifactory server with a local docker repository configure.
I want to push images to that repo.
I have Windows 2016 and installed Docker:
Docker version 1.12.2-cs2-ws-beta, build 050b611
I have creating the daemon.json configuration file in order to set the daemon to work with insecure registries and and edit the json as:
{"insecure-registries": ["art:8080"]}
I tag my image with:
docker tag java art:8080/java
then im trying to push it to Artifactory with:
docker push art:8080/java
when executing this command im getting:
The push refers to a repository
[art:8080/java]
932b647616fa: Preparing
de57d9086f9a: Skipped foreign layer
f358be10862c: Skipped foreign layer
error parsing HTTP 404 response body: unexpected end of JSON input: ""
What does that menas and how can I push the image to my artifactory local repo in an insecure way?
Related
I accidentally deleted image locally in private repository while trying to update it ,
whenever i try to run this command :
docker pull clex-docker-dev-local.de/dba/cs.xyz_ddl_master:latest
Unsupported docker v1 repository request for 'clex-docker-dev-local'
I already tried
Login for the repository 'clex-docker-dev-local`' was successful for me
We have a docker image say xyz:latest which needs to be pushed to my docker registry xxx.com at repo "docker-local" via Jenkins Pipeline
Things were working fine earlier but after updating the artifactory plugins over Jenkins, we are facing the issue with
"INFO: The search failed with "Failed to retrieve repository configuration 'docker-local': HTTP/1.1 400 Bad Request"."
With reference to the code given at (https://www.jfrog.com/confluence/display/JFROG/Setting+Up+Docker+Build-info), more particularly the step 3 part of it, can someone please explain out what does it exactly mean??
// Step 3: Push the image to Artifactory.
// Make sure that <artifactoryDockerRegistry> is configured to reference <targetRepo> Artifactory repository. In cas
def buildInfo = rtDocker.push '<artifactoryDockerRegistry>/hello-world:latest', '<targetRepo>'.
What my values currently for them are:
artifactoryDockerRegistry: "xxx.com/docker-local/xyz:latest"
targetRepo: "docker-local"
Somehow I land-up with the error as mentioned in the comments section of Step3 above.
Can someone please help me with a generic example as to what should the values be??
I am trying to build a image using the original jenkins docker repository but cannot run it. It throws an error saying ": invalid option".
I'm using a Docker Registry on Artifactory. I'm able to pull/push images using docker commands. Now I try to push an image using a Jenkins pipline.
The image is called registry-url/docker/image:latest.
I have a docker repository on Artifactory which is called docker. (I'm able to pull and push to this repo using docker commands).
This stage describes my Artifactory configuration:
...
stage('Deploy Docker image'){
steps {
script {
def server = Artifactory.server 'xxx'
def rtDocker = Artifactory.docker server: server
def buildInfo = rtDocker.push('registry-url/image:latest', 'docker')
//also tried:
//def buildInfo = rtDocker.push('registry-url/docker/image:latest', 'docker')
//the above results in registry/docker/docker/image..
server.publishBuildInfo buildInfo
}
}
}
...
When I use different paths I face the manifest.json error which is probably normal.
I'm able to download the manifest.json manually on: https://registry-url/artifactory/docker/image/latest/manifest.json.
I'm using a pretty new version of Docker on Jenkins:
Docker version 18.01.0-ce, build 03596f51b1
So far so good. But When I run the pipeline I receive the following error in Jenkins (it takes 50 seconds):
Pushing image: registry-url/image:latest
...
com.github.dockerjava.api.exception.DockerClientException: Could not push image: unknown: Not Found
at com.github.dockerjava.core.command.PushImageResultCallback.awaitSuccess(PushImageResultCallback.java:49)
at org.jfrog.hudson.pipeline.docker.utils.DockerUtils.pushImage(DockerUtils.java:60)
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$3.call(DockerAgentUtils.java:213)
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$3.call(DockerAgentUtils.java:205)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
...
In Artifactory logs I see:
2018-04-25 14:24:26,663 [http-nio-8081-exec-xx] [ERROR] (o.a.a.d.r.DockerResource:153) - Unsupported docker v2 repository request for 'image'
2018-04-25 14:24:46,684 [http-nio-8081-exec-xx] [ERROR] (o.a.a.d.r.DockerResource:153) - Unsupported docker v2 repository request for 'image'
2018-04-25 14:24:46,689 [http-nio-8081-exec-xx] [ERROR] (o.a.a.d.r.DockerResource:153) - Unsupported docker v2 repository request for 'image'
2018-04-25 14:24:46,702 [http-nio-8081-exec-xx] [ERROR] (o.a.a.d.r.DockerResource:153) - Unsupported docker v2 repository request for 'image'
What am I missing or doing wrong?
EDIT:
Based on this issue I went back to my initial idea:
def buildInfo = rtDocker.push('registry-url/docker/image:latest', 'docker')
I tried the build again. Error:
Could not find manifest.json in Artifactory in the following path: https://registry-url/artifactory/docker/docker/image/latest/manifest.json
Two times 'docker' in the path and it seems not to work. BUT when I check in Artifactory the image is there... I can also pull the image. It seems to be fine but still the jenkins build is failing.
Artifactory Plugin: 2.15.1
Artifactory Version: 5.10.3
Is this really a bug which will be fixed soon?
Artifcatory can be configured as a docker registry either with or without a reverse proxy.
It looks like your Artifactory is not configured using a reverse-proxy (proxy-less configuration). You can read more about the configuration options here.
Version 2.16.1 of the Jenkins Artifactory Plugin added support for proxy-less configuration. Upgrading your Artifactory Plugin should resolve your issue.
Try following this example. Here we have Jenkins pipeline to pull/push docker image to/from Artifactory: https://github.com/jfrogtraining/kubernetes_example/blob/master/docker-app/Jenkinsfile#L43
I'm integrating Docker with Jenkins, but the build is showing the following error
VERSIONS
- Jenkins version 1.555
- Docker version 0.9.0
Jenkins Plugins
- Mercurial (to pull code from bitbucket)
- Docker (docker-plugin)
- docker-build-step
[Docker] INFO: created container id e463f956d2d4.... (from image my-base)
FATAL: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "ExecDriver"
docker-build-step
I assume that the Docker plugin for Jenkins is very strict about what it expects, and when Docker 0.9 returns an ExecDriver value (for instance, in docker inspect) it gets confused.
The easiest fix is, as you did, roll back to 0.8; but it would be better to fix the Jenkins module; either by using semver (Docker API is versioned) or by making the code accept the ExecDriver attribute optionally.