Jenkins ansible-playbook with tag docker_login error
I try to create docker image and put it into docker registry.
I have docker on server and running Jenkins image. (So Jenkins is a docker container)
Inside Jenkins I have job that should build image out of my code and put it in docker registry.
so
build_docker.yml
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
I get an error
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"}
I try to found what is wrong but I can found anything but:
answer
So my question is, it this error due to a missing docker inside docker container (Jenkins)? Or could be some other reason for this?
This question was edited (previously I have trouble with docker-py library - it is solved now)
PREVIOUS QUESTION
I am trying to execute some ansible-playbook with docker container in Jenkins and I keep getting error...
I have in my Build stap : Invoke Ansible Playbook: and defined yml file.
Inside my yml file I have:
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
Then when I lunch Jenkins job I get :
PLAY [localhost]
***************************************************************
TASK [setup]
*******************************************************************
ok: [localhost]
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to import docker-py - No module named requests.exceptions. Try `pip install docker-py`"}
to retry, use: --limit @/var/jenkins_home/workspace/.../build_docker.retry
What is wrong here... do I need some plug-in or something?
python docker jenkins ansible docker-registry
add a comment |
I try to create docker image and put it into docker registry.
I have docker on server and running Jenkins image. (So Jenkins is a docker container)
Inside Jenkins I have job that should build image out of my code and put it in docker registry.
so
build_docker.yml
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
I get an error
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"}
I try to found what is wrong but I can found anything but:
answer
So my question is, it this error due to a missing docker inside docker container (Jenkins)? Or could be some other reason for this?
This question was edited (previously I have trouble with docker-py library - it is solved now)
PREVIOUS QUESTION
I am trying to execute some ansible-playbook with docker container in Jenkins and I keep getting error...
I have in my Build stap : Invoke Ansible Playbook: and defined yml file.
Inside my yml file I have:
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
Then when I lunch Jenkins job I get :
PLAY [localhost]
***************************************************************
TASK [setup]
*******************************************************************
ok: [localhost]
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to import docker-py - No module named requests.exceptions. Try `pip install docker-py`"}
to retry, use: --limit @/var/jenkins_home/workspace/.../build_docker.retry
What is wrong here... do I need some plug-in or something?
python docker jenkins ansible docker-registry
The message says "Trypip install docker-py
" - did you try that?
– nwinkler
Nov 27 '18 at 11:23
Yes,... But I have jenkins as a docker container,...
– Marko Zadravec
Nov 27 '18 at 11:24
Have you tried installingdocker-py
in there? On one of my RHEL VMs, I had to install thepython-docker-py
package via yum to make the Ansible Docker module work.
– nwinkler
Nov 27 '18 at 11:28
how to install python-docker-py to a running docker container?
– Marko Zadravec
Nov 27 '18 at 11:39
Since you're already using Ansible to do stuff in the container, why not install it via Ansible?
– nwinkler
Nov 27 '18 at 11:45
add a comment |
I try to create docker image and put it into docker registry.
I have docker on server and running Jenkins image. (So Jenkins is a docker container)
Inside Jenkins I have job that should build image out of my code and put it in docker registry.
so
build_docker.yml
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
I get an error
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"}
I try to found what is wrong but I can found anything but:
answer
So my question is, it this error due to a missing docker inside docker container (Jenkins)? Or could be some other reason for this?
This question was edited (previously I have trouble with docker-py library - it is solved now)
PREVIOUS QUESTION
I am trying to execute some ansible-playbook with docker container in Jenkins and I keep getting error...
I have in my Build stap : Invoke Ansible Playbook: and defined yml file.
Inside my yml file I have:
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
Then when I lunch Jenkins job I get :
PLAY [localhost]
***************************************************************
TASK [setup]
*******************************************************************
ok: [localhost]
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to import docker-py - No module named requests.exceptions. Try `pip install docker-py`"}
to retry, use: --limit @/var/jenkins_home/workspace/.../build_docker.retry
What is wrong here... do I need some plug-in or something?
python docker jenkins ansible docker-registry
I try to create docker image and put it into docker registry.
I have docker on server and running Jenkins image. (So Jenkins is a docker container)
Inside Jenkins I have job that should build image out of my code and put it in docker registry.
so
build_docker.yml
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
I get an error
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"}
I try to found what is wrong but I can found anything but:
answer
So my question is, it this error due to a missing docker inside docker container (Jenkins)? Or could be some other reason for this?
This question was edited (previously I have trouble with docker-py library - it is solved now)
PREVIOUS QUESTION
I am trying to execute some ansible-playbook with docker container in Jenkins and I keep getting error...
I have in my Build stap : Invoke Ansible Playbook: and defined yml file.
Inside my yml file I have:
---
- hosts: localhost
vars:
git_branch: "{{ GIT_BRANCH|default('development') }}"
tasks:
- name: Log into Docker registry
docker_login:
registry_url: https://registry.docker....
username: user
password: ....
Then when I lunch Jenkins job I get :
PLAY [localhost]
***************************************************************
TASK [setup]
*******************************************************************
ok: [localhost]
TASK [Log into Docker registry]
************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to import docker-py - No module named requests.exceptions. Try `pip install docker-py`"}
to retry, use: --limit @/var/jenkins_home/workspace/.../build_docker.retry
What is wrong here... do I need some plug-in or something?
python docker jenkins ansible docker-registry
python docker jenkins ansible docker-registry
edited Nov 27 '18 at 12:43
Marko Zadravec
asked Nov 27 '18 at 11:04
Marko ZadravecMarko Zadravec
4,10052950
4,10052950
The message says "Trypip install docker-py
" - did you try that?
– nwinkler
Nov 27 '18 at 11:23
Yes,... But I have jenkins as a docker container,...
– Marko Zadravec
Nov 27 '18 at 11:24
Have you tried installingdocker-py
in there? On one of my RHEL VMs, I had to install thepython-docker-py
package via yum to make the Ansible Docker module work.
– nwinkler
Nov 27 '18 at 11:28
how to install python-docker-py to a running docker container?
– Marko Zadravec
Nov 27 '18 at 11:39
Since you're already using Ansible to do stuff in the container, why not install it via Ansible?
– nwinkler
Nov 27 '18 at 11:45
add a comment |
The message says "Trypip install docker-py
" - did you try that?
– nwinkler
Nov 27 '18 at 11:23
Yes,... But I have jenkins as a docker container,...
– Marko Zadravec
Nov 27 '18 at 11:24
Have you tried installingdocker-py
in there? On one of my RHEL VMs, I had to install thepython-docker-py
package via yum to make the Ansible Docker module work.
– nwinkler
Nov 27 '18 at 11:28
how to install python-docker-py to a running docker container?
– Marko Zadravec
Nov 27 '18 at 11:39
Since you're already using Ansible to do stuff in the container, why not install it via Ansible?
– nwinkler
Nov 27 '18 at 11:45
The message says "Try
pip install docker-py
" - did you try that?– nwinkler
Nov 27 '18 at 11:23
The message says "Try
pip install docker-py
" - did you try that?– nwinkler
Nov 27 '18 at 11:23
Yes,... But I have jenkins as a docker container,...
– Marko Zadravec
Nov 27 '18 at 11:24
Yes,... But I have jenkins as a docker container,...
– Marko Zadravec
Nov 27 '18 at 11:24
Have you tried installing
docker-py
in there? On one of my RHEL VMs, I had to install the python-docker-py
package via yum to make the Ansible Docker module work.– nwinkler
Nov 27 '18 at 11:28
Have you tried installing
docker-py
in there? On one of my RHEL VMs, I had to install the python-docker-py
package via yum to make the Ansible Docker module work.– nwinkler
Nov 27 '18 at 11:28
how to install python-docker-py to a running docker container?
– Marko Zadravec
Nov 27 '18 at 11:39
how to install python-docker-py to a running docker container?
– Marko Zadravec
Nov 27 '18 at 11:39
Since you're already using Ansible to do stuff in the container, why not install it via Ansible?
– nwinkler
Nov 27 '18 at 11:45
Since you're already using Ansible to do stuff in the container, why not install it via Ansible?
– nwinkler
Nov 27 '18 at 11:45
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53498269%2fjenkins-ansible-playbook-with-tag-docker-login-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53498269%2fjenkins-ansible-playbook-with-tag-docker-login-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The message says "Try
pip install docker-py
" - did you try that?– nwinkler
Nov 27 '18 at 11:23
Yes,... But I have jenkins as a docker container,...
– Marko Zadravec
Nov 27 '18 at 11:24
Have you tried installing
docker-py
in there? On one of my RHEL VMs, I had to install thepython-docker-py
package via yum to make the Ansible Docker module work.– nwinkler
Nov 27 '18 at 11:28
how to install python-docker-py to a running docker container?
– Marko Zadravec
Nov 27 '18 at 11:39
Since you're already using Ansible to do stuff in the container, why not install it via Ansible?
– nwinkler
Nov 27 '18 at 11:45