{"action":"created","issue":{"url":"https://api.github.com/repos/containers/skopeo/issues/557","repository_url":"https://api.github.com/repos/containers/skopeo","labels_url":"https://api.github.com/repos/containers/skopeo/issues/557/labels{/name}","comments_url":"https://api.github.com/repos/containers/skopeo/issues/557/comments","events_url":"https://api.github.com/repos/containers/skopeo/issues/557/events","html_url":"https://github.com/containers/skopeo/issues/557","id":368839116,"node_id":"MDU6SXNzdWUzNjg4MzkxMTY=","number":557,"title":"DOCKER_HOST is being ignored?","user":{"login":"alonbl","id":1263789,"node_id":"MDQ6VXNlcjEyNjM3ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/1263789?v=4","gravatar_id":"","url":"https://api.github.com/users/alonbl","html_url":"https://github.com/alonbl","followers_url":"https://api.github.com/users/alonbl/followers","following_url":"https://api.github.com/users/alonbl/following{/other_user}","gists_url":"https://api.github.com/users/alonbl/gists{/gist_id}","starred_url":"https://api.github.com/users/alonbl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonbl/subscriptions","organizations_url":"https://api.github.com/users/alonbl/orgs","repos_url":"https://api.github.com/users/alonbl/repos","events_url":"https://api.github.com/users/alonbl/events{/privacy}","received_events_url":"https://api.github.com/users/alonbl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-10T20:28:22Z","updated_at":"2018-10-11T22:33:46Z","closed_at":"2018-10-10T23:40:03Z","author_association":"NONE","body":"Hello,\r\n\r\nI am using atomic within centos docker image, the image includes docker-client which communicates with docker server using TLS.\r\n\r\nFor some reason the DOCKER_HOST is being ignored. I see that client.go::NewEnvClient should accept the environment, however, I do not see any reference to it, maybe I am missing something. I expect the process to use DOCKER_HOST if explicit host is not provided in command-line.\r\n\r\nThanks!\r\n\r\n```\r\n$ export | grep DOCKER\r\ndeclare -x DOCKER_CERT_PATH=\"/etc/docker\"\r\ndeclare -x DOCKER_HOST=\"tcp://project1-slave01.xxx.com:4243\"\r\ndeclare -x DOCKER_TLS_VERIFY=\"1\"\r\n$ atomic --debug push --sign-by key1@xxx.com project1-master.xxx.com:5002/project1/runtime/review:11790\r\nNamespace(_class=<class 'Atomic.push.Push'>, activation_key=None, anonymous=False, assumeyes=False, debug=True, func='push', gnupghome=None, ignore=False, image='project1-master.xxx.com:5002/project1/runtime/review:11790', insecure=False, password=None, profile=False, pulp=False, reg_type='docker', repo_id=None, satellite=False, sign_by='key1@xxx.com', url=None, username=None, verify_ssl=None)\r\n\r\nSigning with 'key1@xxx.com'\r\n\r\nExecuting: /usr/bin/skopeo --debug copy --remove-signatures --sign-by key1@xxx.com docker-daemon:project1-master.xxx.com:5002/project1/runtime/review:11790 docker://project1-master.xxx.com:5002/project1/runtime/review:11790\r\nDEBU[0000] Using registries.d directory /etc/containers/registries.d for sigstore configuration \r\nDEBU[0000]  Using \"default-docker\" configuration        \r\nDEBU[0000]   Using file:///var/lib/atomic/sigstore      \r\nDEBU[0000] Looking for TLS certificates and private keys in /etc/docker/certs.d/project1-master.xxx.com:5002 \r\nFATA[0000] Error initializing source docker-daemon:project1-master.xxx.com:5002/project1/runtime/review:11790: Error loading image from docker engine: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? \r\n\r\nTraceback (most recent call last):\r\n  File \"/bin/atomic\", line 185, in <module>\r\n    sys.exit(_func())\r\n  File \"/usr/lib/python2.7/site-packages/Atomic/push.py\", line 200, in push\r\n    gpghome=self.args.gnupghome)\r\n  File \"/usr/lib/python2.7/site-packages/Atomic/util.py\", line 454, in skopeo_copy\r\n    return check_call(cmd, env=os.environ)\r\n  File \"/usr/lib/python2.7/site-packages/Atomic/util.py\", line 214, in check_call\r\n    return subprocess.check_call(cmd, env=env, stdin=stdin, stderr=stderr, stdout=stdout, close_fds=True)\r\n  File \"/usr/lib64/python2.7/subprocess.py\", line 542, in check_call\r\n    raise CalledProcessError(retcode, cmd)\r\nCalledProcessError: Command '['/usr/bin/skopeo', '--debug', 'copy', '--remove-signatures', '--sign-by', 'key1@xxx.com', 'docker-daemon:project1-master.xxx.com:5002/project1/runtime/review:11790', 'docker://project1-master.xxx.com:5002/project1/runtime/review:11790']' returned non-zero exit status 1\r\n```"},"comment":{"url":"https://api.github.com/repos/containers/skopeo/issues/comments/429142543","html_url":"https://github.com/containers/skopeo/issues/557#issuecomment-429142543","issue_url":"https://api.github.com/repos/containers/skopeo/issues/557","id":429142543,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTE0MjU0Mw==","user":{"login":"mtrmac","id":7052838,"node_id":"MDQ6VXNlcjcwNTI4Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/7052838?v=4","gravatar_id":"","url":"https://api.github.com/users/mtrmac","html_url":"https://github.com/mtrmac","followers_url":"https://api.github.com/users/mtrmac/followers","following_url":"https://api.github.com/users/mtrmac/following{/other_user}","gists_url":"https://api.github.com/users/mtrmac/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrmac/subscriptions","organizations_url":"https://api.github.com/users/mtrmac/orgs","repos_url":"https://api.github.com/users/mtrmac/repos","events_url":"https://api.github.com/users/mtrmac/events{/privacy}","received_events_url":"https://api.github.com/users/mtrmac/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T22:33:46Z","updated_at":"2018-10-11T22:33:46Z","author_association":"COLLABORATOR","body":"> Following your logic, there must be no defaults in your tools as all must be provided by top level explicitly.\r\n\r\nSure, there is a _default_, it is `unix:///var/run/docker.sock`. We are talking about are different ways of expressing _options_, and environment variables are a non-transparent and risky way to express an option. (In some cases, like `DISPLAY` or `XDG_RUNTIME_DIR`, that option is so widely needed and the implicit inheritance through `fork`/`exec` is so desirable  that an environment variable still ends up being the only practical option; but that’s not the case for a vast majority of options. )\r\n\r\n> Atomic properly document the use of the well known environment variables[1], as expected and working.\r\n\r\nThat’s honestly a surprise to me.[1]\r\n\r\nOTOH, that’s up to the `atomic` command maintainers, and they are perfectly in their right to decide to accept options that way (and it may make sense for them _as a top-level application_). If `atomic` wants to comprehensively implement the `DOCKER_HOST` environment variable, that’s fine with me; it can convert the `DOCKER_HOST` environment variable to `skopeo`’s `--src-docker-host` CLI option, explicitly reflecting in the code that such an option is intended to be supported.\r\n\r\nSo, please report this missing support for `DOCKER_HOST` against the `atomic` project.\r\n\r\nMeanwhile, for the containers/image _library_ really the intent is to minimize accepting options via environment variables, and `skopeo` is designed to be a very thin CLI on top of that library.\r\n\r\n---\r\n\r\n[1] (I’m not sure how `atomic`’s support for `DOCKER_HOST` can be comprehensive considering the references to `/var/lib/docker` on a local host, at least for the `atomic storage` subcommand. And because the `DOCKER_HOST` environment variable is entirely invisible to the code, it’s possible that no-one has considered this case.)"}}
{"actor":{"display_login":"mtrmac"}}