docker-hub-images icon indicating copy to clipboard operation
docker-hub-images copied to clipboard

missing builders

Open oneingan opened this issue 9 years ago • 2 comments

I miss binary builders from official docker images of packer. As docker, qemu-system-x86_64...

oneingan avatar Jun 30 '16 12:06 oneingan

Any update on this? Packer version: v1.3.3 Docker version: 18.09.1 OS version: CentOS Linux release 7.6.1810 (Core)

Tried to perform the following command:

docker run -it --volume "$(pwd)":"$(pwd)" --workdir "$(pwd)" docker.artifactory/hashicorp/packer:light build -var-file=packer-vars.json packer-centos-7-qemu.json

got this error

Build 'qemu' errored: Failed creating Qemu driver: exec: "qemu-system-x86_64": executable file not found in $PATH

Running the FULL one did not help either.

Do i need to pass my PATH somehow to the container?

olegTarassov avatar Jan 30 '19 13:01 olegTarassov

i was able to fix this by modifying the dockerfile to this:

FROM hashicorp/packer

ENV PACKER_LOG=1

RUN apk add qemu-system-x86_64 libvirt qemu-img

Another flavour that is needed until alpine adds libguestfs

FROM hashicorp/packer:light as builder
LABEL author="Oleg Tarassov"

ENV LANG=en_US.utf8
ENV PACKER_LOG=1

FROM centos:latest

COPY --from=builder bin/packer /bin/packer

RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY* && \
    yum install -y epel-release deltarpm

RUN yum install -y qemu-system-x86 qemu-img libguestfs-tools

ENTRYPOINT ["/bin/packer"]

olegTarassov avatar Feb 06 '19 16:02 olegTarassov