debian dockerfiles stable

master
Moisés Guimarães 2017-09-04 13:50:58 -03:00
parent 7b8ae44f32
commit 7d5b8719d1
3 changed files with 133 additions and 2 deletions

85
debian/docker-build.sh vendored 100755
View File

@ -0,0 +1,85 @@
#!/bin/sh
#
# Docker image builder (docker-build.sh)
#
# Copyright (C) 2006-2017 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
WOLFSSL_DOCKER_TAG="latest"
WOLFSSL_VERSION="3.12.0-stable"
WOLFSSL_MAKE_INSTALL="install-exec"
WOLFSSL_INSTALL="libwolfssl12"
function usage()
{
echo "wolfSSL Docker image builder"
echo ""
echo "./docker_build.sh"
echo "\t-h --help prints this help message"
echo "\t--with-dev installs dev files"
echo "\t--from-src installs wolfssl from source files"
echo ""
}
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
-h | --help)
usage
exit
;;
--with-dev)
WOLFSSL_MAKE_INSTALL="install"
WOLFSSL_INSTALL=$WOLFSSL_INSTALL" libwolfssl-dev"
;;
--from-src)
WOLFSSL_INSTALL_FROM_SOURCE=1
;;
--tag)
WOLFSSL_DOCKER_TAG=$VALUE
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
usage
exit 1
;;
esac
shift
done
if [ "$WOLFSSL_INSTALL_FROM_SOURCE" != "1" ]; then
echo "Building docker image using packages from Sid";
echo "Installing the following wolfssl packages: "$WOLFSSL_INSTALL;
echo ;
docker build \
-t wolfssl/debian:$WOLFSSL_DOCKER_TAG \
-f from-aptitude.dockerfile \
--build-arg WOLFSSL_INSTALL="$WOLFSSL_INSTALL" \
.;
else
echo "Building docker image using wolfSSL source files";
echo "Using the following wolfssl make instruction: "$WOLFSSL_MAKE_INSTALL;
echo ;
docker build \
-t wolfssl/debian:$WOLFSSL_DOCKER_TAG \
-f from-source.dockerfile \
--build-arg WOLFSSL_VERSION="$WOLFSSL_VERSION" \
--build-arg WOLFSSL_MAKE_INSTALL="$WOLFSSL_MAKE_INSTALL" \
.;
fi

View File

@ -1,4 +1,4 @@
# Dockerfile
# from-aptitude.dockerfile
#
# Copyright (C) 2006-2017 wolfSSL Inc.
#
@ -20,11 +20,14 @@
FROM debian
# activate WOLFSSL_INSTALLS arg after FROM
ARG WOLFSSL_INSTALL
# install wolfssl from sid
RUN echo "deb http://ftp.it.debian.org/debian sid main contrib non-free" \
> /etc/apt/sources.list.d/wolfssl.list \
&& apt-get update \
&& apt-get install libwolfssl12 libwolfssl-dev \
&& apt-get install ${WOLFSSL_INSTALL} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/apt/sources.list.d/wolfssl.list

43
debian/from-source.dockerfile vendored 100644
View File

@ -0,0 +1,43 @@
# Dockerfile
#
# Copyright (C) 2006-2017 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
FROM debian
ARG WOLFSSL_VERSION
ARG WOLFSSL_MAKE_INSTALL
RUN cd /home \
&& apt-get update \
&& apt-get install -y wget unzip autoconf libtool make \
&& wget https://github.com/wolfSSL/wolfssl/archive/v${WOLFSSL_VERSION}.zip \
&& unzip v${WOLFSSL_VERSION}.zip \
&& cd wolfssl-${WOLFSSL_VERSION} \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make check \
&& make ${WOLFSSL_MAKE_INSTALL} \
&& cd .. \
&& rm -rf wolfssl-${WOLFSSL_VERSION} \
&& rm v${WOLFSSL_VERSION}.zip \
&& apt-get autoremove -y wget unzip autoconf libtool make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*