{"action":"created","issue":{"url":"https://api.github.com/repos/projectatomic/atomic/issues/75","labels_url":"https://api.github.com/repos/projectatomic/atomic/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/projectatomic/atomic/issues/75/comments","events_url":"https://api.github.com/repos/projectatomic/atomic/issues/75/events","html_url":"https://github.com/projectatomic/atomic/issues/75","id":91239116,"number":75,"title":"Revisiting the defaults for `atomic run` with and without --spc","user":{"login":"bexelbie","id":7413661,"avatar_url":"https://avatars.githubusercontent.com/u/7413661?v=3","gravatar_id":"","url":"https://api.github.com/users/bexelbie","html_url":"https://github.com/bexelbie","followers_url":"https://api.github.com/users/bexelbie/followers","following_url":"https://api.github.com/users/bexelbie/following{/other_user}","gists_url":"https://api.github.com/users/bexelbie/gists{/gist_id}","starred_url":"https://api.github.com/users/bexelbie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bexelbie/subscriptions","organizations_url":"https://api.github.com/users/bexelbie/orgs","repos_url":"https://api.github.com/users/bexelbie/repos","events_url":"https://api.github.com/users/bexelbie/events{/privacy}","received_events_url":"https://api.github.com/users/bexelbie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-26T12:35:16Z","updated_at":"2015-07-08T15:49:05Z","closed_at":null,"body":"The current default behavior is inconsistent for SPC and non-SPC invocations (see below).\r\n\r\nIn short, the default for `atomic run --spc` drops you into an interactive session.  The default for `atomic run` is to create a running container that can later be used for commands.\r\n\r\nPR #74 fixes this behavior.\r\n\r\nHowever, I'd like us to rethink this.  I believe a better solution would be something like this:\r\n\r\n`atomic run [--spc] image [command]`:\r\n    if (CREATE LABEL present)\r\n      execute CREATE label passing command if present in an environment variable\r\n    if (RUN LABEL present)\r\n      execute RUN LABEL passing command if present in an environment variable\r\n    else\r\n        use `docker create` to launch the container and then `docker exec` with /bin/bash or command if present\r\n\r\n`atomic start [--spc] image [command]`:\r\n    if (CREATE LABEL present)\r\n      execute CREATE label passing command if present in an environment variable\r\n    else\r\n        use `docker create` to launch the container passing command if present\r\n\r\n\r\n--------------------------------------------------------------------------------\r\nExample of current behavior\r\n--------------------------------------------------------------------------------\r\n# ./atomic run --spc busybox /bin/ps\r\nContainer 'busybox-spc' must be running before executing a command into it.\r\nExecute the following to create the container:\r\n./atomic run --spc --name busybox-spc busybox\r\n# ./atomic run --spc busybox\r\n/usr/bin/docker run -t -i --rm --privileged -v /:/host -v /run:/run -v /etc/localtime:/etc/localtime --net=host --ipc=host --pid=host -e HOST=/host -e NAME=${NAME} -e IMAGE=${IMAGE} ${IMAGE} /bin/sh\r\n<interactive shell>\r\n--------------------------------------------------------------------------------\r\n# ./atomic run busybox /bin/ps\r\nContainer 'busybox' must be running before executing a command into it.\r\nExecute the following to create the container:\r\n./atomic run busybox\r\n# ./atomic run busybox\r\n/usr/bin/docker create -t -i --name ${NAME} ${IMAGE} /bin/sh\r\nbusybox\r\n# docker ps\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES\r\ne7f88fef782d        busybox:latest      \"/bin/sh\"           5 seconds ago       Up 4 seconds                            busybox"},"comment":{"url":"https://api.github.com/repos/projectatomic/atomic/issues/comments/119631706","html_url":"https://github.com/projectatomic/atomic/issues/75#issuecomment-119631706","issue_url":"https://api.github.com/repos/projectatomic/atomic/issues/75","id":119631706,"user":{"login":"rhatdan","id":2000835,"avatar_url":"https://avatars.githubusercontent.com/u/2000835?v=3","gravatar_id":"","url":"https://api.github.com/users/rhatdan","html_url":"https://github.com/rhatdan","followers_url":"https://api.github.com/users/rhatdan/followers","following_url":"https://api.github.com/users/rhatdan/following{/other_user}","gists_url":"https://api.github.com/users/rhatdan/gists{/gist_id}","starred_url":"https://api.github.com/users/rhatdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhatdan/subscriptions","organizations_url":"https://api.github.com/users/rhatdan/orgs","repos_url":"https://api.github.com/users/rhatdan/repos","events_url":"https://api.github.com/users/rhatdan/events{/privacy}","received_events_url":"https://api.github.com/users/rhatdan/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T15:49:05Z","updated_at":"2015-07-08T15:49:05Z","body":"https://github.com/riekrh\r\n"}}