{"action":"created","issue":{"url":"https://api.github.com/repos/anchore/anchore-engine/issues/3","repository_url":"https://api.github.com/repos/anchore/anchore-engine","labels_url":"https://api.github.com/repos/anchore/anchore-engine/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/anchore/anchore-engine/issues/3/comments","events_url":"https://api.github.com/repos/anchore/anchore-engine/issues/3/events","html_url":"https://github.com/anchore/anchore-engine/issues/3","id":270662141,"number":3,"title":"Dockerfile parsing","user":{"login":"JorisAndrade","id":796043,"avatar_url":"https://avatars0.githubusercontent.com/u/796043?v=4","gravatar_id":"","url":"https://api.github.com/users/JorisAndrade","html_url":"https://github.com/JorisAndrade","followers_url":"https://api.github.com/users/JorisAndrade/followers","following_url":"https://api.github.com/users/JorisAndrade/following{/other_user}","gists_url":"https://api.github.com/users/JorisAndrade/gists{/gist_id}","starred_url":"https://api.github.com/users/JorisAndrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorisAndrade/subscriptions","organizations_url":"https://api.github.com/users/JorisAndrade/orgs","repos_url":"https://api.github.com/users/JorisAndrade/repos","events_url":"https://api.github.com/users/JorisAndrade/events{/privacy}","received_events_url":"https://api.github.com/users/JorisAndrade/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-02T13:56:41Z","updated_at":"2017-11-03T09:16:26Z","closed_at":"2017-11-02T23:05:09Z","author_association":"NONE","body":"Hi Guys,\r\n\r\nI think there is an error with the Dockerfile parsing when you use multiline.\r\n\r\n```\r\n2017-11-02 13:46:00+0000 [-] Traceback (most recent call last):\r\n2017-11-02 13:46:00+0000 [-]   File \"/usr/lib/python2.7/site-packages/anchore_engine/services/policy_engine/api/controllers/synchronous_operations.py\", line 227, in check_user_image_inline\r\n2017-11-02 13:46:00+0000 [-]     eval_result = executable_bundle.execute(img_obj, tag, ExecutionContext(db_session=db, configuration={}))\r\n2017-11-02 13:46:00+0000 [-]   File \"/usr/lib/python2.7/site-packages/anchore_engine/services/policy_engine/engine/policy/bundles.py\", line 1074, in execute\r\n2017-11-02 13:46:00+0000 [-]     errors, policy_decision = evaluated_policy.execute(image_obj=image_object, context=context)\r\n2017-11-02 13:46:00+0000 [-]   File \"/usr/lib/python2.7/site-packages/anchore_engine/services/policy_engine/engine/policy/bundles.py\", line 510, in execute\r\n2017-11-02 13:46:00+0000 [-]     exec_context = gate_obj.prepare_context(image_obj, context)\r\n2017-11-02 13:46:00+0000 [-]   File \"/usr/lib/python2.7/site-packages/anchore_engine/services/policy_engine/engine/policy/gates/dockerfile.py\", line 359, in prepare_context\r\n2017-11-02 13:46:00+0000 [-]     directive, remainder = line.split(' ', 1)\r\n2017-11-02 13:46:00+0000 [-] ValueError: need more than 1 value to unpack\r\n```\r\n\r\nSometimes there are no directive\r\n\r\n```\r\nRUN set -ex; \\\r\n    BUILD_DEPS=\"gcc libffi-dev libxml2-dev mariadb-dev musl-dev openssl-dev xmlsec-dev\"; \\\r\n    apk add --no-cache --virtual .build-deps $BUILD_DEPS; \\\r\n    pip install --no-cache-dir --cert /etc/ssl/certs/ca-certificates.crt --requirement requirements.txt; \\\r\n    rm -r requirements.txt; \\\r\n    EXTRA_RUN_DEPS=\"$( \\\r\n        scanelf --needed --nobanner --recursive /usr/local \\\r\n            | awk '{ gsub(/,/, \"\\nso:\", $2); print \"so:\" $2 }' \\\r\n            | sort -u \\\r\n            | xargs -r apk info --installed \\\r\n            | sort -u \\\r\n    )\"; \\\r\n    apk add --no-cache --virtual .run-deps $EXTRA_RUN_DEPS; \\\r\n    apk del .build-deps\r\n```\r\n\r\nYou should handle `\\` here https://github.com/anchore/anchore-engine/blob/master/anchore_engine/services/policy_engine/engine/policy/gates/dockerfile.py#L358\r\n\r\nThanks ! "},"comment":{"url":"https://api.github.com/repos/anchore/anchore-engine/issues/comments/341652566","html_url":"https://github.com/anchore/anchore-engine/issues/3#issuecomment-341652566","issue_url":"https://api.github.com/repos/anchore/anchore-engine/issues/3","id":341652566,"user":{"login":"JorisAndrade","id":796043,"avatar_url":"https://avatars0.githubusercontent.com/u/796043?v=4","gravatar_id":"","url":"https://api.github.com/users/JorisAndrade","html_url":"https://github.com/JorisAndrade","followers_url":"https://api.github.com/users/JorisAndrade/followers","following_url":"https://api.github.com/users/JorisAndrade/following{/other_user}","gists_url":"https://api.github.com/users/JorisAndrade/gists{/gist_id}","starred_url":"https://api.github.com/users/JorisAndrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorisAndrade/subscriptions","organizations_url":"https://api.github.com/users/JorisAndrade/orgs","repos_url":"https://api.github.com/users/JorisAndrade/repos","events_url":"https://api.github.com/users/JorisAndrade/events{/privacy}","received_events_url":"https://api.github.com/users/JorisAndrade/received_events","type":"User","site_admin":false},"created_at":"2017-11-03T09:16:26Z","updated_at":"2017-11-03T09:16:26Z","author_association":"NONE","body":"Thanks ! Is it possible to push a new image of the engine ?\r\n\r\nYou should do an automatic build of master ;)"}}
{"actor":{"display_login":"JorisAndrade"}}