diff --git a/Dockerfile b/Dockerfile index 2d39786..90d9ee4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM grpn/ansible-silo-base:2.0.1 +FROM grpn/ansible-silo-base:3.0.0 ENV ANSIBLE_VERSION v2.4.2.0-1 ENV ANSIBLE_LINT_VERSION 3.4.20 @@ -36,22 +36,25 @@ ENV SILO_IMAGE grpn/ansible-silo ADD silo /silo/ -# Install pip modules from requirements file -ADD pip/requirements /tmp/pip-requirements.txt -RUN pip install -r /tmp/pip-requirements.txt - # Installing Ansible from source RUN git clone --progress https://github.com/ansible/ansible.git /silo/userspace/ansible 2>&1 &&\ cd /silo/userspace/ansible &&\ git checkout --force ${ANSIBLE_VERSION} 2>&1 &&\ - git submodule update --init --recursive 2>&1 &&\ + git submodule update --init --recursive 2>&1 + +# Install pip modules from requirements file +ADD pip/requirements /tmp/pip-requirements.txt +RUN pip install -r /tmp/pip-requirements.txt # Create directory for storing ssh ControlPath - mkdir -p /home/user/.ssh/tmp &&\ +RUN mkdir -p /home/user/.ssh/tmp &&\ # Give the user a custom shell prompt echo 'export PS1="[ansible-silo $SILO_VERSION|\w]\\$ "' > /home/user/.bashrc &&\ +# Add alias for 'ls -l' + echo "alias ll='ls -l'" >> /home/user/.bashrc &&\ + # Set default control path in ssh config echo "ControlPath /home/user/.ssh/tmp/%h_%p_%r" > /etc/ssh/ssh_config &&\ diff --git a/Makefile b/Makefile index 912cd2b..745d726 100644 --- a/Makefile +++ b/Makefile @@ -34,10 +34,16 @@ SILO_IMG := grpn/ansible-silo SILO_VERSION := $(shell cat VERSION) BASE_IMG := grpn/ansible-silo-base -BASE_VERSION := 2.0.1 +BASE_VERSION := 3.0.0 ansible-silo: validate-version @docker build --build-arg "v=$(SILO_VERSION)" --tag "${SILO_IMG}:$(SILO_VERSION)" . + @echo "" + @echo "To install '${SILO_IMG}:${SILO_VERSION}' for just your user, run the following command:" + @echo " docker run --interactive --tty --rm --volume \"${HOME}/bin:/silo_install_path\" ${SILO_IMG}:${SILO_VERSION} --install" + @echo "" + @echo "To install '${SILO_IMG}:${SILO_VERSION}' for all users, run the following command:" + @echo " docker run --interactive --tty --rm --volume \"/usr/local/bin:/silo_install_path\" ${SILO_IMG}:${SILO_VERSION} --install" ansible-silo-base: @docker build --build-arg "v=$(BASE_VERSION)" --file "base.Dockerfile" --tag "${BASE_IMG}:$(BASE_VERSION)" . diff --git a/VERSION b/VERSION index 3e3c2f1..4a36342 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.1 +3.0.0 diff --git a/base.Dockerfile b/base.Dockerfile index f56be4b..41e9314 100644 --- a/base.Dockerfile +++ b/base.Dockerfile @@ -28,7 +28,7 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM alpine:3.6 +FROM python:2.7.14-alpine3.6 ENV container docker ARG v @@ -39,85 +39,85 @@ ADD pip/pip.conf /etc/pip.conf LABEL maintainer="Daniel Schroeder " # Add testing repo, as we need this for installing gosu -RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories &&\ +RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories + +# Install common libraries +RUN apk add --no-cache libssl1.0==1.0.2n-r0\ + libatomic==6.3.0-r4\ + libgomp==6.3.0-r4\ + libffi==3.2.1-r3\ + libgcc==6.3.0-r4\ + libstdc++==6.3.0-r4\ + libxml2==2.9.5-r0\ + libgpg-error==1.27-r0\ + libgcrypt==1.7.9-r0\ + libxslt==1.1.29-r3\ + +# Install development libaries + libxml2-dev==2.9.5-r0\ + libxslt-dev==1.1.29-r3\ + libffi-dev==3.2.1-r3\ + pkgconf==1.3.7-r0\ + musl-dev==1.1.16-r14\ + python2==2.7.14-r0\ + python2-dev==2.7.14-r0\ + openssl-dev==1.0.2n-r0\ + zlib-dev==1.2.11-r0\ # Install curl - apk add --no-cache openssl=1.0.2k-r0\ - ca-certificates=20161130-r2\ - libssh2=1.8.0-r1\ - libcurl=7.55.0-r0\ - curl=7.55.0-r0\ + openssl==1.0.2n-r0\ + curl==7.58.0-r0\ # Install bash - ncurses-terminfo-base=6.0-r8\ - ncurses-terminfo=6.0-r8\ - ncurses-libs=6.0-r8\ - readline=6.3.008-r5\ - bash=4.3.48-r1\ + bash==4.3.48-r1\ # Install git - perl=5.24.1-r2\ - expat=2.2.0-r1\ - pcre=8.41-r0\ - git=2.13.5-r0\ + pcre==8.41-r0\ + git==2.13.5-r0\ # Install python - libbz2=1.0.6-r5\ - libffi=3.2.1-r3\ - gdbm=1.12-r0\ - sqlite-libs=3.18.0-r0\ - py-netifaces=0.10.5-r3\ - -# Install pip - py2-pip=9.0.1-r1\ + py-netifaces==0.10.5-r3\ + py2-netifaces==0.10.5-r3\ # Install Ansible dependencies - yaml=0.1.7-r0\ - gmp=6.1.2-r0\ + yaml==0.1.7-r0\ + gmp==6.1.2-r0\ # Install gosu, which enables us to run Ansible as the user who started the container gosu@testing=1.9-r0\ - sudo=1.8.19_p2-r0\ + sudo==1.8.19_p2-r0\ # Install ssh - openssh-client=7.5_p1-r1\ - openssh-sftp-server=7.5_p1-r1\ - openssh=7.5_p1-r1\ - sshpass=1.06-r0 &&\ - -# Install some required python modules which need compiling - apk add --no-cache gcc=6.3.0-r4\ - musl=1.1.16-r13\ - musl-dev=1.1.16-r13\ - musl-utils=1.1.16-r13\ - binutils-libs=2.28-r2\ - binutils=2.28-r2\ - isl=0.17.1-r0\ - libgomp=6.3.0-r4\ - libatomic=6.3.0-r4\ - pkgconf=1.3.7-r0\ - libgcc=6.3.0-r4\ - mpfr3=3.1.5-r0\ - mpc1=1.0.3-r0\ - libstdc++=6.3.0-r4\ - zlib-dev=1.2.11-r0\ - python2-dev=2.7.13-r1\ - openssl-dev=1.0.2k-r0\ - libffi-dev=3.2.1-r3\ - libxml2-dev=2.9.4-r4\ - libxslt-dev=1.1.29-r3 &&\ - - pip install asn1crypto==0.22.0\ - cffi==1.10.0\ - cryptography==2.0.2\ + openssh-keygen==7.5_p1-r2\ + openssh-client==7.5_p1-r2\ + openssh-sftp-server==7.5_p1-r2\ + openssh==7.5_p1-r2\ + sshpass==1.06-r0\ + +# Install tools for compiling python + gcc==6.3.0-r4\ + binutils-libs==2.28-r3\ + binutils==2.28-r3\ + isl==0.17.1-r0\ + mpfr3==3.1.5-r0\ + make==4.2.1-r0\ + mpc1==1.0.3-r0 &&\ + +# Add the python libraries + pip install asn1crypto==0.24.0\ + bcrypt==3.1.4\ + cffi==1.11.4\ + cryptography==2.1.4\ enum34==1.1.6\ - idna==2.5\ - ipaddress==1.0.18\ - ncclient==0.5.3\ - paramiko==1.16.0\ + idna==2.6\ + ipaddress==1.0.19\ + lxml==4.1.1\ + paramiko==2.4.0\ + pyasn1==0.4.2\ pycparser==2.18\ - pycrypto==2.6.1\ - six==1.10.0 &&\ + pynacl==1.2.1\ + napalm==2.3.0\ + six==1.11.0 &&\ apk del --no-cache gcc\ python2-dev\ @@ -127,7 +127,6 @@ RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/ isl\ libgomp\ libatomic\ - pkgconf\ libgcc\ mpfr3\ mpc1\ @@ -137,10 +136,10 @@ RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/ openssl-dev\ libffi-dev\ libxml2-dev\ - libxslt-dev &&\ + libxslt-dev - # Install docker command and ensure it's always executed w/ sudo - curl -fL -o /tmp/docker.tgz "https://download.docker.com/linux/static/stable/x86_64/docker-17.06.0-ce.tgz" &&\ +# Install docker command and ensure it's always executed w/ sudo +RUN curl -fL -o /tmp/docker.tgz "https://download.docker.com/linux/static/stable/x86_64/docker-17.06.0-ce.tgz" &&\ tar -xf /tmp/docker.tgz --exclude docker/docker?* -C /tmp &&\ mv /tmp/docker/docker /usr/local/bin/real-docker &&\ rm -rf /tmp/docker /tmp/docker.tgz &&\ diff --git a/pip/requirements b/pip/requirements index 5815114..5ca8f56 100644 --- a/pip/requirements +++ b/pip/requirements @@ -1,12 +1,13 @@ -docker==2.5.1 -docker-compose==1.15 -docker-py==1.10.6 +docker==2.7.0 +docker-compose==1.19.0 +docker-pycreds==0.2.2 +dockerpty==0.4.1 ecdsa==0.13 -httplib2==0.9.2 +httplib2==0.10.3 jinja2==2.8 jmespath==0.9.3 -markupsafe==0.23 +markupsafe==1.0 netaddr==0.7.19 -pexpect==4.2.1 +pexpect==4.4.0 ptyprocess==0.5.2 -pyyaml==3.11 +pyyaml==3.12 diff --git a/silo/bundle/build b/silo/bundle/build index 6a2143a..584004d 100755 --- a/silo/bundle/build +++ b/silo/bundle/build @@ -43,9 +43,24 @@ if [[ -f "playbooks/requirements.yml" ]]; then cd .. fi +# If there is a PIP requirements file, install it using pip +if [[ -f "playbooks/requirements.txt" ]]; then + cd playbooks || exit + pip install -r requirements.txt || exit + cd .. +fi + # Build as "latest" image docker build --build-arg "v=${bundle_version}" \ --tag "${bundle_image}:${bundle_version}" . || exit docker tag "$(docker images --quiet "${bundle_image}:${bundle_version}")" \ "${bundle_image}:latest" || exit + +# Show installation instructions +echo "" +echo "To install '${bundle_image}:${bundle_version}' for just your user, run the following command:" +echo " docker run --interactive --tty --rm --volume \"${HOME}/bin:/silo_install_path\" ${bundle_image}:${bundle_version} --install" +echo "" +echo "To install '${bundle_image}:${bundle_version}' for all users, run the following command:" +echo " docker run --interactive --tty --rm --volume \"/usr/local/bin:/silo_install_path\" ${bundle_image}:${bundle_version} --install"