Cannot install Ansible So I am creating a packer template for docker with the image php:7.0-apache.
I added a shell provisioner where I try to install ansible so I can provision the image:

{
            "type": "shell",
            "inline": [
                "apt-get -y update",
                "apt-get install -y software-properties-common",
                "apt-add-repository ppa:ansible/ansible",
                "apt-get -y update",

                "apt-get install -y sudo",
                "apt-get install -y ansible"
            ]
        },


However, I get this error. Why is that?


EDIT: After installing the gnupg package, there still seems to be issues that result in the building process to fail:
As it says, No such file or directory: 'gpg', so you probably need to install gnupg before adding the PPA repository:

apt-get install gnupg