Unverified Commit 412128b6 authored by Diego Hernandes's avatar Diego Hernandes Committed by GitHub
Browse files

Merge pull request #36 from codecasts/base-images

Base Images and MailParse extension.
parents 573ac4ba 1f90d3d6
......@@ -47,6 +47,20 @@ The examples on this documentation are now updated to reflect this decision.
The original names are kept, and it should not break working scripts.
## Base Images
If you want, you can use the base images as your starting point on this repository:
The available images are:
| Image Name | Tag | FROM Example | Description
| - | - | - | -
| codecasts/alpine-3.7 | php-7.2 | `FROM codecasts/alpine-3.7:php-7.2` | PHP 7.2 on Alpine v3.7
| codecasts/alpine-3.7 | php-7.1 | `FROM codecasts/alpine-3.7:php-7.2` | PHP 7.1 on Alpine v3.7
| codecasts/alpine-3.6 | php-7.2 | `FROM codecasts/alpine-3.6:php-7.2` | PHP 7.2 on Alpine v3.6
| codecasts/alpine-3.6 | php-7.1 | `FROM codecasts/alpine-3.6:php-7.1` | PHP 7.1 on Alpine v3.6
## Snippets
The following code snippets are intended for quick usage on either shell scripts or Dockerfile
......
#!/usr/bin/env bash
## Function to Pull base Alpine Images.
function pull_images {
# verbose.
echo -e "\n\n=====> Pulling Alpine Images:\n"
# loop the versions and pull each one.
for ALPINE_VERSION in $ALPINE_VERSIONS; do
# verbose.
echo -e "\n\n=====> Pulling Alpine v$ALPINE_VERSION\n"
# execute docker pull.
docker pull "alpine:$ALPINE_VERSION"
done
}
# pull image functions.
function build_images {
# verbose.
echo -e "\n\n=====> Building PHP versions: $PHP_VERSIONS\n"
# loop the versions of alpine.
for ALPINE_VERSION in $ALPINE_VERSIONS; do
# loop the PHP versions to build.
for PHP_VERSION in $PHP_VERSIONS; do
# alias the target image name.
TARGET="codecasts/alpine-$ALPINE_VERSION:php-$PHP_VERSION"
# verbose.
echo -e "\n\n=====> Building Image: $TARGET\n"
# execute the docker build.
docker build -t "$TARGET" -f "alpine-$ALPINE_VERSION-php-$PHP_VERSION" .
done
# end PHP loop.
done
# end Alpine loop.
}
# publish images.
function publish_images {
# verbose.
echo -e "\n\n=====> Building Images:\n"
# loop the versions of alpine.
for ALPINE_VERSION in $ALPINE_VERSIONS; do
# loop the PHP versions to publish.
for PHP_VERSION in $PHP_VERSIONS; do
# alias the target image name.
TARGET="codecasts/alpine-$ALPINE_VERSION:php-$PHP_VERSION"
# verbose
echo -e "\n\n=====> Publishing Image: $TARGET\n"
# execute the docker push
docker push $TARGET
done
# end PHP loop.
done
# end Alpine loop.
}
\ No newline at end of file
# Use Alpine v3.6.
FROM alpine:3.6
# Image maintainer.
LABEL maintainer="diego@hernandev.com"
# trust this project public key to trust the packages.
ADD http://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
# make sure you can use HTTPS
RUN apk --update add ca-certificates wget curl
# add the repository, make sure you replace the correct versions if you want.
RUN echo "@php http://php.codecasts.rocks/v3.6/php-7.1" >> /etc/apk/repositories
# install php and some extensions
# notice the @php is required to avoid getting default php packages from alpine instead.
RUN apk add --update \
php@php \
php-bcmath@php \
php-bz2@php \
php-calendar@php \
php-ctype@php \
php-curl@php \
# php7-dba@php \
php-dom@php \
php-embed@php \
# php7-enchant@php \
# php7-exif@php \
# php7-ftp@php \
php-gd@php \
php-gettext@php \
php-gmp@php \
php-iconv@php \
php-imagick@php \
php-imap@php \
php-intl@php \
php-json@php \
# php7-ldap@php \
# php7-lightspeed@php \
php-mbstring@php \
# php7-mcrypt@php \
# php7-msqli@php \
php-mysqlnd@php \
# php7-odbc@php \
php-opcache@php \
php-openssl@php \
# php7-pcntl@php \
php-pdo@php \
# php7-pdo_dblib@php \
php-pdo_mysql@php \
php-pdo_sqlite@php \
# php7-pear@php \
php-pgsql@php \
php-phar@php \
# php7-phpdbg@php \
php-posix@php \
# php7-pgspell@php \
php-session@php \
# php7-shmop@php \
# php7-snmp@php \
php-soap@php \
php-sockets@php \
php-sqlite3@php \
# php7-sysvmsg@php \
# php7-sysvsem@php \
# php7-sysvshm@php \
# php7-tidy@php \
# php7-wddx@php \
php-xml@php \
php-xmlreader@php \
# php7-xmlrpc@php \
# php7-xsl@php \
php-zip@php \
php-zlib@php
\ No newline at end of file
# Use Alpine v3.6.
FROM alpine:3.6
# Image maintainer.
LABEL maintainer="diego@hernandev.com"
# trust this project public key to trust the packages.
ADD http://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
# make sure you can use HTTPS
RUN apk --update add ca-certificates wget curl
# add the repository, make sure you replace the correct versions if you want.
RUN echo "@php http://php.codecasts.rocks/v3.6/php-7.2" >> /etc/apk/repositories
# install php and some extensions
# notice the @php is required to avoid getting default php packages from alpine instead.
RUN apk add --update \
php@php \
php-bcmath@php \
php-bz2@php \
php-calendar@php \
php-ctype@php \
php-curl@php \
# php7-dba@php \
php-dom@php \
php-embed@php \
# php7-enchant@php \
# php7-exif@php \
# php7-ftp@php \
php-gd@php \
php-gettext@php \
php-gmp@php \
php-iconv@php \
php-imagick@php \
php-imap@php \
php-intl@php \
php-json@php \
# php7-ldap@php \
# php7-lightspeed@php \
php-mbstring@php \
# php7-mcrypt@php \
# php7-msqli@php \
php-mysqlnd@php \
# php7-odbc@php \
php-opcache@php \
php-openssl@php \
# php7-pcntl@php \
php-pdo@php \
# php7-pdo_dblib@php \
php-pdo_mysql@php \
php-pdo_sqlite@php \
# php7-pear@php \
php-pgsql@php \
php-phar@php \
# php7-phpdbg@php \
php-posix@php \
# php7-pgspell@php \
php-session@php \
# php7-shmop@php \
# php7-snmp@php \
php-soap@php \
php-sockets@php \
php-sqlite3@php \
# php7-sysvmsg@php \
# php7-sysvsem@php \
# php7-sysvshm@php \
# php7-tidy@php \
# php7-wddx@php \
php-xml@php \
php-xmlreader@php \
# php7-xmlrpc@php \
# php7-xsl@php \
php-zip@php \
php-zlib@php
\ No newline at end of file
# Use Alpine v3.7.
FROM alpine:3.7
# Image maintainer.
LABEL maintainer="diego@hernandev.com"
# trust this project public key to trust the packages.
ADD https://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
# make sure you can use HTTPS
RUN apk --update add ca-certificates wget curl
# add the repository, make sure you replace the correct versions if you want.
RUN echo "@php https://php.codecasts.rocks/v3.7/php-7.1" >> /etc/apk/repositories
# install php and some extensions
# notice the @php is required to avoid getting default php packages from alpine instead.
RUN apk add --update \
php@php \
php-bcmath@php \
php-bz2@php \
php-calendar@php \
php-ctype@php \
php-curl@php \
# php7-dba@php \
php-dom@php \
php-embed@php \
# php7-enchant@php \
# php7-exif@php \
# php7-ftp@php \
php-gd@php \
php-gettext@php \
php-gmp@php \
php-iconv@php \
php-imagick@php \
php-imap@php \
php-intl@php \
php-json@php \
# php7-ldap@php \
# php7-lightspeed@php \
php-mbstring@php \
# php7-mcrypt@php \
# php7-msqli@php \
php-mysqlnd@php \
# php7-odbc@php \
php-opcache@php \
php-openssl@php \
# php7-pcntl@php \
php-pdo@php \
# php7-pdo_dblib@php \
php-pdo_mysql@php \
php-pdo_sqlite@php \
# php7-pear@php \
php-pgsql@php \
php-phar@php \
# php7-phpdbg@php \
php-posix@php \
# php7-pgspell@php \
php-session@php \
# php7-shmop@php \
# php7-snmp@php \
php-soap@php \
php-sockets@php \
php-sqlite3@php \
# php7-sysvmsg@php \
# php7-sysvsem@php \
# php7-sysvshm@php \
# php7-tidy@php \
# php7-wddx@php \
php-xml@php \
php-xmlreader@php \
# php7-xmlrpc@php \
# php7-xsl@php \
php-zip@php \
php-zlib@php
\ No newline at end of file
# Use Alpine v3.7.
FROM alpine:3.7
# Image maintainer.
LABEL maintainer="diego@hernandev.com"
# trust this project public key to trust the packages.
ADD https://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
# make sure you can use HTTPS
RUN apk --update add ca-certificates wget curl
# add the repository, make sure you replace the correct versions if you want.
RUN echo "@php https://php.codecasts.rocks/v3.7/php-7.2" >> /etc/apk/repositories
# install php and some extensions
# notice the @php is required to avoid getting default php packages from alpine instead.
RUN apk add --update \
php@php \
php-bcmath@php \
php-bz2@php \
php-calendar@php \
php-ctype@php \
php-curl@php \
# php7-dba@php \
php-dom@php \
php-embed@php \
# php7-enchant@php \
# php7-exif@php \
# php7-ftp@php \
php-gd@php \
php-gettext@php \
php-gmp@php \
php-iconv@php \
php-imagick@php \
php-imap@php \
php-intl@php \
php-json@php \
# php7-ldap@php \
# php7-lightspeed@php \
php-mbstring@php \
# php7-mcrypt@php \
# php7-msqli@php \
php-mysqlnd@php \
# php7-odbc@php \
php-opcache@php \
php-openssl@php \
# php7-pcntl@php \
php-pdo@php \
# php7-pdo_dblib@php \
php-pdo_mysql@php \
php-pdo_sqlite@php \
# php7-pear@php \
php-pgsql@php \
php-phar@php \
# php7-phpdbg@php \
php-posix@php \
# php7-pgspell@php \
php-session@php \
# php7-shmop@php \
# php7-snmp@php \
php-soap@php \
php-sockets@php \
php-sqlite3@php \
# php7-sysvmsg@php \
# php7-sysvsem@php \
# php7-sysvshm@php \
# php7-tidy@php \
# php7-wddx@php \
php-xml@php \
php-xmlreader@php \
# php7-xmlrpc@php \
# php7-xsl@php \
php-zip@php \
php-zlib@php
\ No newline at end of file
#!/usr/bin/env bash
######################################
#### Build for Base images. ####
######################################
# List of Alpine versions to Use as Base.
ALPINE_VERSIONS="3.6 3.7"
# List of PHP versions to build.
PHP_VERSIONS="7.1 7.2"
# include the build functions.
source $(pwd)/_functions.sh
# Pull Alpine versions.
pull_images
# Build the Docker base images.
build_images
# Publish the resulting images.
publish_images
/src
\ No newline at end of file
# Maintainer: "Diego Hernandes <diego@hernandev.com>"
pkgname=php7-mailparse
_pkgreal=mailparse
pkgver=3.0.2
pkgrel=10
_phpver=7
provides="php-mailparse=7.1"
pkgdesc="Mailparse extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.1.0 php7-common<7.2.0 php7-pear>=7.1.0 php7-pear<7.2.0 php7-mbstring>=7.1.0 php7-mbstring<7.2.0"
makedepends="php7-dev>=7.1.0 php7-dev<7.2.0 autoconf zlib-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
prepare() {
default_prepare || return 1
}
build() {
cd "$builddir"
phpize$_phpver || return 1
./configure --prefix=/usr \
--with-php-config=/usr/bin/php-config$_phpver || return 1
make || return 1
}
package() {
mkdir -p "$pkgdir" || return 1
install -d $pkgdir/ || return 1
make -C "$builddir" INSTALL_ROOT="$pkgdir" install || return 1
install -d "$pkgdir"/etc/php$_phpver/conf.d || return 1
echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php$_phpver/conf.d/20_$_pkgreal.ini || return 1
}
sha512sums="be04e15cf3577542447186d7ead4e31159c171c99de0a255d4ee2f6f760b80ecb44be056bd9089180601f622b9a71f4331f194e1adaa702d1d964009682896f6 mailparse-3.0.2.tgz"
/src
\ No newline at end of file
# Maintainer: "Diego Hernandes <diego@hernandev.com>"
pkgname=php7-mailparse
_pkgreal=mailparse
pkgver=3.0.2
pkgrel=10
_phpver=7
provides="php-mailparse=7.2"
pkgdesc="Mailparse extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.2.0 php7-common<7.3.0 php7-pear>=7.2.0 php7-pear<7.3.0 php7-mbstring>=7.2.0 php7-mbstring<7.3.0"
makedepends="php7-dev>=7.2.0 php7-dev<7.3.0 autoconf zlib-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
prepare() {
default_prepare || return 1
}
build() {
cd "$builddir"
phpize$_phpver || return 1
./configure --prefix=/usr \
--with-php-config=/usr/bin/php-config$_phpver || return 1
make || return 1
}
package() {
mkdir -p "$pkgdir" || return 1
install -d $pkgdir/ || return 1
make -C "$builddir" INSTALL_ROOT="$pkgdir" install || return 1
install -d "$pkgdir"/etc/php$_phpver/conf.d || return 1
echo "extension=$_pkgreal" > "$pkgdir"/etc/php$_phpver/conf.d/20_$_pkgreal.ini || return 1
}
sha512sums="be04e15cf3577542447186d7ead4e31159c171c99de0a255d4ee2f6f760b80ecb44be056bd9089180601f622b9a71f4331f194e1adaa702d1d964009682896f6 mailparse-3.0.2.tgz"
/src
\ No newline at end of file
# Maintainer: "Diego Hernandes <diego@hernandev.com>"
pkgname=php7-mailparse
_pkgreal=mailparse
pkgver=3.0.2
pkgrel=10
_phpver=7
provides="php-mailparse=7.1"
pkgdesc="Mailparse extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.1.0 php7-common<7.2.0 php7-pear>=7.1.0 php7-pear<7.2.0 php7-mbstring>=7.1.0 php7-mbstring<7.2.0"
makedepends="php7-dev>=7.1.0 php7-dev<7.2.0 autoconf zlib-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
prepare() {
default_prepare || return 1
}
build() {
cd "$builddir"
phpize$_phpver || return 1
./configure --prefix=/usr \
--with-php-config=/usr/bin/php-config$_phpver || return 1
make || return 1
}
package() {
mkdir -p "$pkgdir" || return 1
install -d $pkgdir/ || return 1
make -C "$builddir" INSTALL_ROOT="$pkgdir" install || return 1
install -d "$pkgdir"/etc/php$_phpver/conf.d || return 1
echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php$_phpver/conf.d/20_$_pkgreal.ini || return 1
}
sha512sums="be04e15cf3577542447186d7ead4e31159c171c99de0a255d4ee2f6f760b80ecb44be056bd9089180601f622b9a71f4331f194e1adaa702d1d964009682896f6 mailparse-3.0.2.tgz"
/src
\ No newline at end of file
# Maintainer: "Diego Hernandes <diego@hernandev.com>"
pkgname=php7-mailparse
_pkgreal=mailparse
pkgver=3.0.2
pkgrel=10
_phpver=7
provides="php-mailparse=7.2"
pkgdesc="Mailparse extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.2.0 php7-common<7.3.0 php7-pear>=7.2.0 php7-pear<7.3.0 php7-mbstring>=7.2.0 php7-mbstring<7.3.0"
makedepends="php7-dev>=7.2.0 php7-dev<7.3.0 autoconf zlib-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
prepare() {
default_prepare || return 1
}
build() {
cd "$builddir"
phpize$_phpver || return 1
./configure --prefix=/usr \
--with-php-config=/usr/bin/php-config$_phpver || return 1
make || return 1
}
package() {
mkdir -p "$pkgdir" || return 1
install -d $pkgdir/ || return 1
make -C "$builddir" INSTALL_ROOT="$pkgdir" install || return 1
install -d "$pkgdir"/etc/php$_phpver/conf.d || return 1
echo "extension=$_pkgreal" > "$pkgdir"/etc/php$_phpver/conf.d/20_$_pkgreal.ini || return 1
}
sha512sums="be04e15cf3577542447186d7ead4e31159c171c99de0a255d4ee2f6f760b80ecb44be056bd9089180601f622b9a71f4331f194e1adaa702d1d964009682896f6 mailparse-3.0.2.tgz"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment