{"action":"created","issue":{"url":"https://api.github.com/repos/pachyderm/pfs/issues/75","labels_url":"https://api.github.com/repos/pachyderm/pfs/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/pachyderm/pfs/issues/75/comments","events_url":"https://api.github.com/repos/pachyderm/pfs/issues/75/events","html_url":"https://github.com/pachyderm/pfs/issues/75","id":87279233,"number":75,"title":"Minimize the size of our docker container","user":{"login":"jdoliner","id":43867,"avatar_url":"https://avatars.githubusercontent.com/u/43867?v=3","gravatar_id":"","url":"https://api.github.com/users/jdoliner","html_url":"https://github.com/jdoliner","followers_url":"https://api.github.com/users/jdoliner/followers","following_url":"https://api.github.com/users/jdoliner/following{/other_user}","gists_url":"https://api.github.com/users/jdoliner/gists{/gist_id}","starred_url":"https://api.github.com/users/jdoliner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdoliner/subscriptions","organizations_url":"https://api.github.com/users/jdoliner/orgs","repos_url":"https://api.github.com/users/jdoliner/repos","events_url":"https://api.github.com/users/jdoliner/events{/privacy}","received_events_url":"https://api.github.com/users/jdoliner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-11T09:33:56Z","updated_at":"2015-06-13T11:06:01Z","closed_at":null,"body":"Our container's size is starting to be an annoyance. AWS would come up way quicker if we could reduce its size.\r\n\r\nThis shouldn't be too hard, our whole server can pretty easily be made in to a static binary."},"comment":{"url":"https://api.github.com/repos/pachyderm/pfs/issues/comments/111698440","html_url":"https://github.com/pachyderm/pfs/issues/75#issuecomment-111698440","issue_url":"https://api.github.com/repos/pachyderm/pfs/issues/75","id":111698440,"user":{"login":"peter-edge","id":4228796,"avatar_url":"https://avatars.githubusercontent.com/u/4228796?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-edge","html_url":"https://github.com/peter-edge","followers_url":"https://api.github.com/users/peter-edge/followers","following_url":"https://api.github.com/users/peter-edge/following{/other_user}","gists_url":"https://api.github.com/users/peter-edge/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-edge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-edge/subscriptions","organizations_url":"https://api.github.com/users/peter-edge/orgs","repos_url":"https://api.github.com/users/peter-edge/repos","events_url":"https://api.github.com/users/peter-edge/events{/privacy}","received_events_url":"https://api.github.com/users/peter-edge/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T11:06:00Z","updated_at":"2015-06-13T11:06:00Z","body":"Only thing you need to take care of is lib/btrfs/btrfs.go\r\n\r\nThe functions in there shell out to `btrfs` and `sync`. `sync` you can handle, but `btrfs` goes to `/bin/btrfs`/ which is `chroot /host brtrfs`, and a minimal docker container with the `scratch` base image won't have chroot (or anything else). You can do this with os/syscall package, but...well read bout it haha. And it changes the whole go process which is obviously not ok.\r\n\r\nBut ya, there's solutions to this. If you don't care about absolute minimal binary, you could use either the `busybox` or `gliderlabs/alpine` images instead, which are still super small, and have chroot. What you think?\r\n\r\nOnly other super common thing to worry about (haven't gone through the code yet) is if you do any HTTP calls anywhere, or plan to, root certs aren't available. So you can add them straight up (just copy them from CoreOS), or I put together this https://github.com/peter-edge/go-cacerts for this exact reason. Be careful to cache any objects you use from `cacerts` though, a ton of memory is allocated for each call to `cacerts.NewX509CertPool()`."}}