packer-qemu/image/Dockerfile

38 lines
962 B
Docker
Raw Normal View History

FROM hashicorp/packer:1.6.3
2020-02-09 14:30:03 +00:00
2020-02-11 12:49:01 +00:00
ARG PROXY=""
ENV http_proxy="${PROXY}"
ENV https_proxy="${PROXY}"
2020-02-10 07:40:08 +00:00
ARG USER=packer
ARG GROUP=packer
WORKDIR /packer
RUN apk add --update qemu qemu-system-x86_64 qemu-img \
2020-02-27 07:33:53 +00:00
vim htop util-linux gzip sysfsutils openssh-client \
2020-03-03 22:20:24 +00:00
openssh-keygen sudo ansible sshpass curl
2020-02-10 07:40:08 +00:00
RUN addgroup -g 1000 "${GROUP}" && \
adduser -u 1000 -D -G "${GROUP}" "${USER}" && \
adduser "${USER}" qemu && \
2020-02-10 07:40:08 +00:00
echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER && \
chmod 0440 /etc/sudoers.d/$USER
# setup mitogen to enhance ansible speed
ENV MITOGEN_VERSION="0.2.9"
RUN wget https://networkgenomics.com/try/mitogen-${MITOGEN_VERSION}.tar.gz && \
tar xvf mitogen-${MITOGEN_VERSION}.tar.gz && \
mv mitogen-${MITOGEN_VERSION} /mitogen && \
rm mitogen-${MITOGEN_VERSION}.tar.gz
2020-02-10 07:40:08 +00:00
USER "${USER}"
2020-02-09 14:30:03 +00:00
ENV PACKER_LOG=1
ENV PACKER_CACHE_DIR=/packer-cache
2020-02-10 07:40:08 +00:00
ENV PS1="[\u@\h \W]# "
2020-02-09 14:30:03 +00:00
ENTRYPOINT ["/packer/run-packer.sh"]
2020-02-09 14:30:03 +00:00