{"action":"created","issue":{"url":"https://api.github.com/repos/buildkite/feedback/issues/144","repository_url":"https://api.github.com/repos/buildkite/feedback","labels_url":"https://api.github.com/repos/buildkite/feedback/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/buildkite/feedback/issues/144/comments","events_url":"https://api.github.com/repos/buildkite/feedback/issues/144/events","html_url":"https://github.com/buildkite/feedback/issues/144","id":128717770,"number":144,"title":"Add an alpine package for the buildkite agent","user":{"login":"mbj","id":117966,"avatar_url":"https://avatars1.githubusercontent.com/u/117966?v=4","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-01-26T04:05:33Z","updated_at":"2018-04-27T07:45:05Z","closed_at":null,"author_association":"NONE","body":"In the current situation when the agents environment on alpine needs to be customized the customization has to be done on top of the `buildkite/agent:latest` image.\n\nWhen the customization goes very deep, some setup that is specific to this docker image needs to be un-done first (like setting `USER root` to perform some privileged operations).\n\nTo ease the use of the agent in an alpine env, I propose to create a package overlay (and maybe get it later into an official alpine package) that contains the agent as an apline package.\n\nThis fixes various issues:\n- The `Dockerfile` for `buildkite/agent` gets simplified because:\n  - Installing an APK is an operation on verified inputs whereas the old installation method effectively piped unverfied shell script into bash\n  - Dependencies can be installed explicitly, so the apk package manager tracks the reason the buildkite agents dependencies are installed\n  - Other init systems than `tini` can be used.\n- Adding the agent to an alpine image that was tuned to provide adjacent services (example postgresql) is easier\n\nReference discussion in the Slack channel:\n\nhttps://buildkitechat.slack.com/archives/docker/p1453771611000002\n\nI did an example APK package + build environment in this repository:\n- https://github.com/mbj/alpine-packages\n\nFeel free to use this build environment and the `APKBUILD` file as a template to manage your official package overlay. Make sure you remove traces from my work like the `alpine-packages` S3 buckets (bucket names are global) and my name from from the packages metadata.\n"},"comment":{"url":"https://api.github.com/repos/buildkite/feedback/issues/comments/384892603","html_url":"https://github.com/buildkite/feedback/issues/144#issuecomment-384892603","issue_url":"https://api.github.com/repos/buildkite/feedback/issues/144","id":384892603,"user":{"login":"mbj","id":117966,"avatar_url":"https://avatars1.githubusercontent.com/u/117966?v=4","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T07:45:05Z","updated_at":"2018-04-27T07:45:05Z","author_association":"NONE","body":"So the APKBUILD was:\r\n\r\n```\r\n# Contributor: Markus Schirp <mbj@schirp-dso.com>\r\n# Maintainer: Markus Schirp <mbj@schirp-dso.com>\r\npkgname=buildkite-agent\r\npkgver=2.1.4\r\npkgrel=0\r\npkgdesc=\"Buildkite Agent\"\r\nurl=\"buildkite.com\"\r\narch=\"x86_64\"\r\nlicense=\"MIT\"\r\ndepends=\"openssh-client git perl\"\r\ninstall=\"$pkgname.pre-install\"\r\nsubpackages=\"\"\r\nsource=\"https://github.com/buildkite/agent/releases/download/v2.1.4/buildkite-agent-linux-386-2.1.4.tar.gz\"\r\n\r\nprepare() {\r\n        cd $srcdir\r\n}\r\n\r\nbuild() {\r\n        cd $srcdir\r\n}\r\n\r\npackage() {\r\n        cd $srcdir\r\n        install -Dm755 \"buildkite-agent\"     \"$pkgdir/usr/bin/buildkite-agent\"\r\n        install -Dm755 \"bootstrap.sh\"        \"$pkgdir/usr/lib/buildkite/bootstrap.sh\"\r\n        install -Dm755 \"buildkite-agent.cfg\" \"$pkgdir/etc/buildkite-agent.cfg\"\r\n}\r\n\r\nmd5sums=\"eac7ef91ff6004e771bcfa150041f2ab  buildkite-agent-linux-386-2.1.4.tar.gz\"\r\nsha256sums=\"9126faf1edf6eaab2fa1a90bc1f4ce4d634adf696c9af18af39829bfc166cc5e  buildkite-agent-linux-386-2.1.4.tar.gz\"\r\nsha512sums=\"e745cd5f2637e3b65abc61ed7fc389b72fce07f0498c11f939165bc0634d773ebcfb97bb0cd5d5f1d555aa78353d0bb1bbfcdfa0731e3f4f152072128987cac5  buildkite-agent-linux-386-2.1.4.tar.gz\"\r\n```\r\n\r\nAnd the `buildkite-agent.pre-install` was:\r\n\r\n```\r\n#!/bin/sh\r\nexec adduser -D -h /var/buildkite buildkite\r\n```\r\n\r\nNote that this is untested as of right now, I did this back in 2016, and moved on to a different solution meanwhile."}}
{"actor":{"display_login":"mbj"}}