packer build -var account_file=/path/to/credential.json --var project_id=your-proj-id jessie-base.json
packer build -var account_file=/path/to/credential.json --var project_id=your-proj-id sid-base.json
- replace ntp with systemd-timesyncd
packer build -var account_file=/path/to/credential.json --var project_id=your-proj-id jessie-base.json
packer build -var account_file=/path/to/credential.json --var project_id=your-proj-id sid-base.json
| { | |
| "variables": { | |
| "account_file": "", | |
| "project_id": "" | |
| }, | |
| "builders": [{ | |
| "type": "googlecompute", | |
| "account_file": "{{user `account_file`}}", | |
| "project_id": "{{user `project_id`}}", | |
| "source_image": "debian-8-jessie-v20151104", | |
| "zone": "asia-east1-a", | |
| "machine_type": "f1-micro", | |
| "image_name": "jessie-base" | |
| }], | |
| "provisioners":[{ | |
| "type": "shell", | |
| "inline": [ | |
| "apt-get update", | |
| "apt-get install -y --no-install-recommends etckeeper", | |
| "echo 'Asia/Tokyo' > /etc/timezone", | |
| "dpkg-reconfigure -f noninteractive tzdata", | |
| "etckeeper commit 'setup timezone'", | |
| "apt-get upgrade -y --no-install-recommends --auto-remove --purge" | |
| ], | |
| "environment_vars": [ | |
| "DEBIAN_FRONTEND=noninteractive" | |
| ] | |
| }] | |
| } |
| { | |
| "variables": { | |
| "account_file": "", | |
| "project_id": "" | |
| }, | |
| "builders": [{ | |
| "type": "googlecompute", | |
| "account_file": "{{user `account_file`}}", | |
| "project_id": "{{user `project_id`}}", | |
| "source_image": "jessie-base", | |
| "zone": "asia-east1-a", | |
| "machine_type": "f1-micro", | |
| "image_name": "sid-base" | |
| }], | |
| "provisioners":[ | |
| { | |
| "type": "file", | |
| "source": "sources.list", | |
| "destination": "/etc/apt/sources.list" | |
| }, | |
| { | |
| "type": "shell", | |
| "inline": [ | |
| "etckeeper commit 'apt: updated to sid'", | |
| "apt-get remove -y --purge --auto-remove ntp", | |
| "apt-get update", | |
| "apt-get dist-upgrade -y --no-install-recommends --auto-remove --purge" | |
| ], | |
| "environment_vars": [ | |
| "DEBIAN_FRONTEND=noninteractive" | |
| ] | |
| } | |
| ] | |
| } |
| ## | |
| ## stable | |
| ## | |
| deb http://httpredir.debian.org/debian/ stable main non-free contrib | |
| deb-src http://httpredir.debian.org/debian/ stable main non-free contrib | |
| deb http://httpredir.debian.org/debian/ stable-updates main contrib non-free | |
| deb-src http://httpredir.debian.org/debian/ stable-updates main contrib non-free | |
| deb http://security.debian.org/ stable/updates main contrib non-free | |
| deb-src http://security.debian.org/ stable/updates main contrib non-free | |
| ## | |
| ## testing | |
| ## | |
| deb http://httpredir.debian.org/debian/ testing main non-free contrib | |
| deb-src http://httpredir.debian.org/debian/ testing main non-free contrib | |
| ## | |
| ## sid | |
| ## | |
| deb http://httpredir.debian.org/debian/ sid main non-free contrib | |
| deb-src http://httpredir.debian.org/debian/ sid main non-free contrib | |
| ## | |
| ## experimental | |
| ## | |
| deb http://httpredir.debian.org/debian/ experimental main non-free contrib | |
| deb-src http://httpredir.debian.org/debian/ experimental main non-free contrib | |