I am trying to build a image using the original jenkins docker repository but cannot run it. It throws an error saying ": invalid option".
Related
I am facing an issue on Travis CI. I seem not to be able to use the repository name as an environment variable.
I have a Travis build that is setup to build, tag and push a Docker image.
In the after_success section of the .travis.yml file the following command is running
docker build -t ${PROJECT}:${TRAVIS_BRANCH} .
(The environment variable ${PROJECT} is the actual name of the repository and is set in the repository settings.)
The problem is that Docker is using "[secure]" as image name instead of the repository name. I end up with something like
Successfully tagged [secure]:staging
After that when I am tagging the image the following error is returned
Error parsing reference: "/[secure]:staging" is not a valid repository/tag: invalid reference format
I have tried to update ${PROJECT} to a random string and it worked fine.
Is there a way to use the repository name as a environment variable?
It seems as if your $PROJECT contains a leading slash which might be the problem.
With this minimal Jenkins Pipeline script
node {
docker.build("foo", "--build-arg x=y")
}
I'm getting a confusing error
"docker build" requires exactly 1 argument(s).
But as per the documentation, the signature of docker.build() is build(image[, args]) (from Jenkins /job/dockerbug/pipeline-syntax/globals#docker)
build(image[, args])
Runs docker build to create and tag the specified
image from a Dockerfile in the current directory. Additional args may
be added, such as '-f Dockerfile.other --pull --build-arg
http_proxy=http://192.168.1.1:3128 .'. Like docker build, args must
end with the build context. Returns the resulting Image object.
Records a FROM fingerprint in the build.
What's going on?
My confusion was because the error message is actually coming from Docker, not Jenkins.
Docker gives this error if you don't specify a build context (as noted in the docs above).
The fix is just to add . to the end of the args parameter as per the example, eg:
node {
docker.build("foo", "--build-arg x=y .")
}
See docker: "build" requires 1 argument. See 'docker build --help'
I set up Kubernetes executor, but when I tried to run pipeline I got this error:
ERROR: Job failed: image pull failed: Tag x86_64-a3da309 not found in
repository docker.io/gitlab/gitlab-runner-helper
I set some public docker image in gitlab-ci.yml
Someone have idea what can be wrong?
under the valid tags for that image you'll find the image you're looking for. x86_64-a3da309d
So just add a d to the tag and it should work.
I'm a beginner with Jenkins CI integration with Docker.
My virtual machine tcp://192.168.99.100:2376
I created an image "personluz" with my SVN source code and the configuration like this image
image config
But the result is:
error
FATAL: Cannot run program "docker": error=2, No such file or directory
Could anyone have some idea? Thanks
First, the tag highlighted in the first picture is not the one for the personluz image (it is one of a dangling image)
The tag for personluz is b7782bf4cf30.
Second, a Cannot run program "docker": error=2 means that, in the context of the Jenkins slave executing the job, docker is not found in the Jenkins user $PATH. Make sure it is properly installed for that Jenkins user.
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.