Use jwilder/nginx-proxy as base image and reduce final image size

This commit is contained in:
David Parrish 2015-11-23 00:03:14 -05:00 committed by JrCs
parent 02af7cd3c1
commit a4b00222ab
2 changed files with 32 additions and 26 deletions

View file

@ -1,31 +1,9 @@
FROM jwilder/nginx-proxy FROM jwilder/nginx-proxy
MAINTAINER [ "David Parrish <daveparrish@tutanota.com", "Yves Blusseau <90z7oey02@sneakemail.com>", "Hadrien Mary <hadrien.mary@gmail.com>" ]
RUN apt-get update MAINTAINER David Parrish <daveparrish@tutanota.com>
MAINTAINER Yves Blusseau <90z7oey02@sneakemail.com>
# Install python packages needed by simp_le
RUN apt-get install -y -q --no-install-recommends python python-requests
# Install python packages needed to build simp_le
RUN apt-get install -y -q --no-install-recommends git gcc libssl-dev libffi-dev python-dev python-pip
# Get Let's Encrypt simp_le client source
RUN git -C /opt clone https://github.com/kuba/simp_le.git
WORKDIR /opt/simp_le
# Upgrade setuptools
RUN pip install -U setuptools
# Install simp_le in /usr/local/bin
RUN python ./setup.py install
# Make house cleaning
RUN rm -rf /opt/simp_le
RUN apt-get autoremove -y git gcc libssl-dev libffi-dev python-dev python-pip
RUN apt-get clean all
RUN rm -r /var/lib/apt/lists/*
COPY . /app/ COPY . /app/
WORKDIR /app/ # Install simp_le program
RUN chmod +rx /app/install_simp_le.sh && /app/install_simp_le.sh && rm -f /app/install_simp_le.sh

28
install_simp_le.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
set -e
apt-get update
# Install python packages needed by simp_le
apt-get install -y -q --no-install-recommends python python-requests
# Install python packages needed to build simp_le
apt-get install -y -q --no-install-recommends git gcc libssl-dev libffi-dev python-dev python-pip
# Get Let's Encrypt simp_le client source
git -C /opt clone https://github.com/kuba/simp_le.git
cd /opt/simp_le
# Upgrade setuptools
pip install -U setuptools
# Install simp_le in /usr/local/bin
python ./setup.py install
# Make house cleaning
rm -rf /opt/simp_le
apt-get autoremove -y git gcc libssl-dev libffi-dev python-dev python-pip
apt-get clean all
rm -r /var/lib/apt/lists/*