{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3760","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3760/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3760/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3760/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/3760","id":157093017,"number":3760,"title":"ansible docker_image can't find a locally available image on build","user":{"login":"supremekai","id":5133901,"avatar_url":"https://avatars.githubusercontent.com/u/5133901?v=3","gravatar_id":"","url":"https://api.github.com/users/supremekai","html_url":"https://github.com/supremekai","followers_url":"https://api.github.com/users/supremekai/followers","following_url":"https://api.github.com/users/supremekai/following{/other_user}","gists_url":"https://api.github.com/users/supremekai/gists{/gist_id}","starred_url":"https://api.github.com/users/supremekai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supremekai/subscriptions","organizations_url":"https://api.github.com/users/supremekai/orgs","repos_url":"https://api.github.com/users/supremekai/repos","events_url":"https://api.github.com/users/supremekai/events{/privacy}","received_events_url":"https://api.github.com/users/supremekai/received_events","type":"User","site_admin":false},"labels":[{"id":132571937,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":132897218,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":397590879,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/docker","name":"docker","color":"e99695","default":false},{"id":414073372,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/waiting_on_maintainer","name":"waiting_on_maintainer","color":"d93f0b","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-05-26T22:28:01Z","updated_at":"2016-12-05T12:17:08Z","closed_at":"2016-08-05T21:29:59Z","body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\n##### ISSUE TYPE\n\n<!--- Pick one below and delete the rest: -->\n- Bug Report\n##### COMPONENT NAME\n\n<!--- Name of the plugin/module/task -->\n\ndocker_image\n##### ANSIBLE VERSION\n\n```\nansible 2.1.0.0\n  config file = /home/user/scratch/deployment/ansible/ansible.cfg\n  configured module search path = Default w/o overrides\n```\n##### CONFIGURATION\n\n<!---\nMention any settings you have changed/added/removed in ansible.cfg\n(or using the ANSIBLE_* environment variables).\n-->\n\nN/A\n##### OS / ENVIRONMENT\n\nOS: N/A\ndocker-py 1.8.1\ndocker version\n\n```\nClient:\n Version:      1.11.1\n API version:  1.23\n Go version:   go1.5.4\n Git commit:   5604cbe\n Built:        Tue Apr 26 23:30:23 2016\n OS/Arch:      linux/amd64\n\nServer:\n Version:      1.11.1\n API version:  1.23\n Go version:   go1.5.4\n Git commit:   5604cbe\n Built:        Tue Apr 26 23:30:23 2016\n OS/Arch:      linux/amd64\n```\n##### SUMMARY\n\nWhen building a docker image locally Ansible fails to find a locally available base image specified in the  `FROM` directive of the dockerfile. \nResulting Error:\n\n```\nfatal: [localhost]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"Error building localhost:5000/image - code: None message: Error: image library/base_image not found\"}\n```\n\n[See this similar issue with docker compose](https://github.com/docker/compose/issues/1568)\n##### STEPS TO REPRODUCE\n\nCreate docker registry\n\n```\n-   name: Creating docker registry\n    docker:\n        name: registry\n        image: \"registry:2\"\n        state: started\n        restart_policy: always\n        ports:\n            - \"5000:5000\"\n        env:\n            REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry\n        volumes:\n            \"{{host_registry_dir}}:/var/lib/registry\"\n```\n\nBuild, tag, push base image\n\n```\n-   name: Create base_image locally\n    docker_image:\n        name: \"{{private_docker_registry}}/base_image\"\n        path: \"{{build_folder}}/dockerfiles/base_image\"\n        dockerfile: base_image.Dockerfile\n```\n\nBuild,tag,push child image\n\n```\n-   name: Create image locally\n    docker_image:\n        name: \"{{private_docker_registry}}/image\"\n        path: \"{{build_folder}}/dockerfiles/image\"\n        dockerfile: image.Dockerfile\n```\n\nSimplified `image.Dockerfile` using the locally built base_image as its base:\n\n```\nFROM base_image\n\nEXPOSE 5555\n\nENTRYPOINT [\"./entrypoint.sh\"]\n```\n##### EXPECTED RESULTS\n\n<!--- What did you expect to happen when running the steps above? -->\n\ndocker image to be built, tagged, and pushed to the local registry.\n##### ACTUAL RESULTS\n\n<!--- What actually happened? If possible run with high verbosity (-vvvv) -->\n\nThe image failed to build as its base image could not be located.\n\nOutput:\n\n```\nfatal: [localhost]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"Error building localhost:5000/image - code: None message: Error: image library/base_image not found\"}\n```\n\nSetting `pull: no` seemed to resolve this. But there are two issues with this firstly it is confusing as the docs state \n\n> \"When building an image downloads any updates to the FROM image in Dockerfile.\" \n\nand secondly executed unusually slow and produced another error:\n\n```\nfatal: [localhost]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"Error: configuration for localhost:5000 not found. Try logging into localhost:5000 first.\"}\n```\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/264840092","html_url":"https://github.com/ansible/ansible-modules-core/issues/3760#issuecomment-264840092","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3760","id":264840092,"user":{"login":"alex-cg1","id":23655047,"avatar_url":"https://avatars.githubusercontent.com/u/23655047?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-cg1","html_url":"https://github.com/alex-cg1","followers_url":"https://api.github.com/users/alex-cg1/followers","following_url":"https://api.github.com/users/alex-cg1/following{/other_user}","gists_url":"https://api.github.com/users/alex-cg1/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-cg1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-cg1/subscriptions","organizations_url":"https://api.github.com/users/alex-cg1/orgs","repos_url":"https://api.github.com/users/alex-cg1/repos","events_url":"https://api.github.com/users/alex-cg1/events{/privacy}","received_events_url":"https://api.github.com/users/alex-cg1/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T12:17:08Z","updated_at":"2016-12-05T12:17:08Z","body":"Plus one on this. The problem is puzzling. The manual build works fine, so should do docker_image."}}
{"actor":{"display_login":"alex-cg1"}}