Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
1 result

docker-packer-arm

  • Clone with SSH
  • Clone with HTTPS
  • Jan Grewe's avatar
    Jan Grewe authored
    75cddbb7
    History
    Name Last commit Last update
    Dockerfile
    README.md
    entrypoint.sh

    Packer ARM builder

    This Docker image can be used to build ARM images like Raspbian with Packer.

    Usage

    docker run --rm -v ${PWD}:/build -v ${PWD}/packer_cache:/build/packer_cache -v ${PWD}/output:/build/output -v /dev:/dev --privileged jangrewe/packer-arm:latest build my-image.json
    • my-image.json:
    {
      "variables": {
        "img_mount_path": "{{ env `PWD` }}/mnt",
      },
      "builders": [
        {
          "name": "my-image",
          "type": "arm-image",
          "iso_url": "https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-09-30/2019-09-26-raspbian-buster-lite.zip",
          "iso_checksum_type": "sha256",
          "iso_checksum": "a50237c2f718bd8d806b96df5b9d2174ce8b789eda1f03434ed2213bbca6c6ff",
          "mount_path": "{{ user `img_mount_path` }}",
          "output_directory": "output"
        }
      ],
      "provisioners": [
        {
          "type": "shell-local",
          "inline": [
            "sudo -E ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook -i '{{ user `img_mount_path` }}', -c chroot ./my-image.yml"
          ]
        }
      ]
    }
    
    • my-image.yml: a regular Ansible playbook

    Thanks