{"id":13602088,"url":"https://github.com/deployable/alpine-ami","last_synced_at":"2025-08-17T11:33:06.970Z","repository":{"id":149113356,"uuid":"86924008","full_name":"deployable/alpine-ami","owner":"deployable","description":"Alpine Linux EC2 AMI + VirtualBox OVF","archived":false,"fork":false,"pushed_at":"2017-06-15T01:59:13.000Z","size":61,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-07T05:38:31.592Z","etag":null,"topics":["alpine-linux","ami","ansible","ec2","packer"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deployable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-01T15:47:11.000Z","updated_at":"2024-10-06T20:47:05.000Z","dependencies_parsed_at":"2023-04-26T01:01:57.072Z","dependency_job_id":null,"html_url":"https://github.com/deployable/alpine-ami","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deployable%2Falpine-ami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deployable%2Falpine-ami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deployable%2Falpine-ami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deployable%2Falpine-ami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deployable","download_url":"https://codeload.github.com/deployable/alpine-ami/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230121667,"owners_count":18176477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine-linux","ami","ansible","ec2","packer"],"created_at":"2024-08-01T18:01:13.867Z","updated_at":"2024-12-17T13:10:46.266Z","avatar_url":"https://github.com/deployable.png","language":"Shell","funding_links":[],"categories":["ansible","Shell"],"sub_categories":[],"readme":"# Alpine Linux AMI Build\n\nBuild an [Alpine Linux](https://www.alpinelinux.org) EC2 AMI, Virtualbox OVF or PXE initrd\nwith [Packer](https://www.packer.io) and [Ansible](https://www.ansible.com).\n\n\n- [Install](#install)\n- [EC2 AMI](#build-ami)\n- [Vagrant box](#build-vagrant-box)\n- [VirtualBox OVF](#build-virtualbox-ovf)\n- [PXE initrd](#build-pxe-initrd)\n\n\n## Install\n\nClone the repo\n\n```shell\ngit clone https://github.com/deployable/alpine-ami \u0026\u0026 cd alpine-ami\n```\n\nThe build requires `packer` and `ansible-playbook` to run.\n\nOn a mac, use [brew](https://brew.sh).\n```shell\nbrew install packer\nbrew install ansible\n```\n\nOn Linux, [download](https://www.packer.io/downloads.html) or check your package \nmanager. Ansible is available via `pip install ansible`, on epel in RHEL and on \n`ppa:ansible/ansible` in Ubuntu.\n\n\n### Testing\n\nIncluded is a [Terraform](https://terraform.io) config to launch the instance. \n\n\n## Build AMI\n\nBuilding requires a VPC subnet and security group that allows SSH access.\nYou can specify a region as well. \n\n```shell\n./make.sh aws subnet-XXXXXXXX sg-XXXXXXXX eu-central-1\n```\n\n_Note:_ The build doesn't pick up the default ssh public key from AWS at the moment so the \nansible `pubkey` variable is locally configured. If you want to regenerate the key just\ndelete them from `./playbook` and the next `make` will create a new one.\n\n\n### Test\n\nAfter building you can bring up the AMI (output at the end of the build step) on a nano \ninstance via an included [Terraform](https://terraform.io) config.\n\n```shell\n./make.sh test ami-[id] subnet-XXXXXXXX sg-XXXXXXXX eu-central-1\n./make.sh ssh [instance_ip]\n./make.sh test_destroy ami-[id] subnet-XXXXXXXX sg-XXXXXXXX eu-central-1\n```\n\n\n### Environment\n\nThe subnet, security group and region can be set in your shells environment for the build \nand test commands to use.\n\n```\nexport AWS_SUBNET=X\nexport AWS_SECURITY_GROUP=X\nexport AWS_REGION=X\n```\n\n\n\n## Build Vagrant Box\n\nThe same build can be applied to produce a Vagrant box \n\n```shell\n./make.sh vagrant\n```\n_Note:_ The guest additions are not installed\n\n\n### Test\n\nRequries [Vagrant](https://vagrantup.com).\n\n```shell\n./make.sh add_vagrant\nvagrant ssh\n```\n\n\n\n## Build VirtualBox OVF\n\nThe same build can be applied to VirtualBox to produce an OVF appliance.\n\n```shell\n./make.sh virtualbox\n```\n_Note:_ The guest additions are not installed\n\n\n### Test\n\nFor Virtualbox you need to import the OVF and add a host only adapter, a \nbridge adapter, or NAT mapping to port to 22. Then you can ssh to it\n\n```shell\nVBoxManage import ./output-vbox/alpine-vbox.ovf \nVBoxManage modifyvm alpine-vbox --natpf1 \"tcp-port,tcp,,2202,,22\"\nVBoxManage startvm alpine-vbox --type separate\nSSH_ARGS=\"-p 2202\" ./make.sh ssh localhost\n```\n\n\n## Build PXE initrd\n\n```shell\n./make.sh pxe\n```\nThe initrd is exported to `output-pxe-3.5.2/pxerd`\n\n## Issues\n\n### Slow VM startup\n\nAlpine 3.5 can run out of entropy making sshd startup slow: https://bugs.alpinelinux.org/issues/6635\n\n\n## About\n\nMatt Hoyle - code aatt deployable.co\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeployable%2Falpine-ami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeployable%2Falpine-ami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeployable%2Falpine-ami/lists"}