commit 66c29365033db8260c88343de1f5b83d6fafba33 Author: Luke Murphy Date: Thu Jan 7 00:00:38 2021 +0100 Init this thing diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..03c9b1c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,16 @@ +--- +kind: pipeline +name: push container to docker hub +steps: + - name: build container + image: plugins/docker + settings: + username: + from_secret: docker_reg_username + password: + from_secret: docker_reg_passwd + repo: decentral1se/molecule + tags: latest +trigger: + branch: + - main diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ed3dae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,157 @@ +# This is a multi-stage build which requires Docker 17.05 or higher +FROM docker.io/alpine:edge as molecule-builder + +WORKDIR /usr/src/molecule + +# WARNING: Reasons not to add edge/testing: +# * Breaks security scanning due to https://github.com/quay/clair/issues/901 +# * Unreliable builds, as alpinelinux CDN is unreliable for edge, returning 404 +# quite often. +# edge/testing needed for: py3-arrow +RUN apk add -v --progress --update --no-cache \ +docker-py \ +gcc \ +git \ +libffi-dev \ +libvirt \ +libvirt-dev \ +make \ +musl-dev \ +openssl-dev \ +py3-bcrypt \ +py3-botocore \ +py3-certifi \ +py3-cffi \ +py3-chardet \ +py3-click \ +py3-colorama \ +py3-cryptography \ +py3-distlib \ +py3-docutils \ +py3-flake8 \ +py3-future \ +py3-idna \ +py3-jinja2 \ +py3-libvirt \ +py3-markupsafe \ +py3-mccabe \ +py3-netifaces \ +py3-paramiko \ +py3-pbr \ +py3-pip \ +py3-pluggy \ +py3-psutil \ +py3-ptyprocess \ +py3-py \ +py3-pycodestyle \ +py3-pynacl \ +py3-pytest \ +py3-requests \ +py3-ruamel \ +py3-setuptools \ +py3-simplejson \ +py3-urllib3 \ +py3-virtualenv \ +py3-websocket-client \ +py3-yaml \ +python3 \ +python3-dev + +ENV MOLECULE_PLUGINS="\ +molecule-hetznercloud +" + +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917006 +RUN python3 -m pip install -U wheel pip setuptools + +ADD . . + +RUN \ +python3 -m pip wheel \ +-w dist \ +molecule testinfra ${MOLECULE_PLUGINS} + +RUN ls -1 dist/ + +# ✄--------------------------------------------------------------------- +# This is an actual target container: + +FROM alpine:edge +LABEL maintainer="decentral1se " + +ENV PACKAGES="\ +docker \ +git \ +openssh-client \ +docker-py \ +libvirt \ +rsync \ +py3-bcrypt \ +py3-botocore \ +py3-certifi \ +py3-cffi \ +py3-chardet \ +py3-click \ +py3-colorama \ +py3-cryptography \ +py3-docutils \ +py3-flake8 \ +py3-idna \ +py3-jinja2 \ +py3-mccabe \ +py3-netifaces \ +py3-paramiko \ +py3-pbr \ +py3-pip \ +py3-pluggy \ +py3-psutil \ +py3-ptyprocess \ +py3-py \ +py3-pycodestyle \ +py3-pynacl \ +py3-pytest \ +py3-requests \ +py3-ruamel \ +py3-setuptools \ +py3-urllib3 \ +py3-virtualenv \ +py3-websocket-client \ +python3 \ +" + +ENV BUILD_DEPS="\ +gcc \ +libc-dev \ +libvirt-dev \ +make \ +" + +ENV PIP_INSTALL_ARGS="\ +--only-binary :all: \ +--no-index \ +-f /usr/src/molecule/dist \ +" + +ENV MOLECULE_PLUGINS="\ +molecule-hetznercloud \ +" + +RUN \ +apk add --update --no-cache \ +${BUILD_DEPS} ${PACKAGES} \ +&& apk del --no-cache ${BUILD_DEPS} \ +&& rm -rf /root/.cache + +COPY --from=molecule-builder \ +/usr/src/molecule/dist \ +/usr/src/molecule/dist + +RUN \ +python3 -m pip install \ +${PIP_INSTALL_ARGS} \ +molecule testinfra ${MOLECULE_PLUGINS} && \ +molecule --version && \ +molecule drivers && \ +pip check + +ENV SHELL /bin/bash diff --git a/README.md b/README.md new file mode 100644 index 0000000..843345f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# molecule-image + +[Because](https://github.com/ansible-community/molecule/commit/ba6496563bbe360693a409657c9c1515df6482eb).