2023-05-06 17:36:12 +00:00
|
|
|
ARG ALPINE_VERSION=3.17
|
2023-05-06 10:56:29 +00:00
|
|
|
ARG UID=1000
|
|
|
|
ARG GID=1000
|
|
|
|
|
|
|
|
FROM alpine:$ALPINE_VERSION
|
|
|
|
ARG UID
|
|
|
|
ARG GID
|
|
|
|
|
2023-05-06 17:36:12 +00:00
|
|
|
SHELL ["/bin/sh", "-exc"]
|
2023-05-06 10:56:29 +00:00
|
|
|
|
2023-05-06 17:36:12 +00:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
ansible-core \
|
|
|
|
jq \
|
|
|
|
packer \
|
|
|
|
&& adduser ansible -u "$UID" -D -h /home/ansible "$GID" \
|
|
|
|
&& mkdir -p /configs /manifests /cache \
|
|
|
|
&& chown ansible /manifests /configs /cache
|
2023-05-06 10:56:29 +00:00
|
|
|
|
|
|
|
USER ansible
|
|
|
|
WORKDIR /home/ansible
|
2023-05-06 17:36:12 +00:00
|
|
|
COPY default.json default.json
|
|
|
|
COPY alpine.pkr.hcl alpine.pkr.hcl
|
|
|
|
COPY playbook.yml playbook.yml
|
|
|
|
COPY --chmod=u=rx,og= entrypoint.sh entrypoint.sh
|
2023-05-06 10:56:29 +00:00
|
|
|
|
|
|
|
VOLUME /cache
|
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/sh", "entrypoint.sh"]
|
|
|
|
CMD ["default.json"]
|