add ansible-portable to the default packer image. https://github.com/ownport/portable-ansible
FROM hashicorp/packer:1.6.4
RUN apk add --update python3
ADD https://github.com/ownport/portable-ansible/releases/download/v0.4.2/portable-ansible-v0.4.2-py3.tar.bz2 ./
RUN bunzip2 portable-ansible-v0.4.2-py3.tar.bz2 && tar vxf portable-ansible-v0.4.2-py3.tar && ln -s ansible ansible-playbook && ln -s ansible ansible-galaxy
RUN rm -f portable-ansible-v0.4.2-py3.tar
COPY ./script-ansible /usr/bin/ansible
COPY ./script-playbook /usr/bin/ansible-playbook
COPY ./script-galaxy /usr/bin/ansible-galaxy
RUN chmod +x /usr/bin/ansible*
ENTRYPOINT ["/bin/packer"]
script-ansible for example:
#!/bin/ash
python3 /ansible $@
Content type
Image
Digest
Size
164.3 MB
Last updated
almost 6 years ago
docker pull boolman/packer:164-290-4