Removing support for ubuntu based image, updated composer to 2.8.4, update on all alpine based image
Build and Push Alpine based Composer Image / Build and push composer on alpine based image (push) Successful in 2m57s Details

This commit is contained in:
Muhamad Aditya Prima 2024-12-13 18:29:31 +07:00
parent a6ea6b366d
commit 4644dd24e0
8 changed files with 530 additions and 279 deletions

View File

@ -0,0 +1,131 @@
name: Build and Push Alpine based Composer Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push composer on alpine based image
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: aprimediet
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push 2.2 on php5.6
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php5
build-args: |
COMPOSER_VERSION=2.2.25
PHP_VERSION=5.6
push: true
tags: |
aprimediet/composer:2.2.25-php5.6-alpine
aprimediet/composer:2.2-php5.6-alpine
- name: Build and push 2.8 on php7.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php7
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=7.2
push: true
tags: |
aprimediet/composer:2.8.4-php7.2-alpine
aprimediet/composer:2.8-php7.2-alpine
- name: Build and push 2.8 on php7.3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php7
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=7.3
push: true
tags: |
aprimediet/composer:2.8.4-php7.3-alpine
aprimediet/composer:2.8-php7.3-alpine
- name: Build and push 2.8 on php7.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php7
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=7.4
push: true
tags: |
aprimediet/composer:2.8.4-php7.4-alpine
aprimediet/composer:2.8-php7.4-alpine
- name: Build and push 2.8 on php8.0
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.0
push: true
tags: |
aprimediet/composer:2.8.0-php8.0-alpine
aprimediet/composer:2.8-php8.0-alpine
- name: Build and push 2.8 on php8.1
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.1
push: true
tags: |
aprimediet/composer:2.8.4-php8.1-alpine
aprimediet/composer:2.8-php8.1-alpine
- name: Build and push 2.8 on php8.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.2
push: true
tags: |
aprimediet/composer:2.8.4-php8.2-alpine
aprimediet/composer:2.8-php8.2-alpine
- name: Build and push 2.8 on php8.3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.3
push: true
tags: |
aprimediet/composer:2.8.4-php8.3-alpine
aprimediet/composer:2.8-php8.3-alpine
- name: Build and push 2.8 on php8.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.4
push: true
tags: |
aprimediet/composer:2.8.4-php8.4-alpine
aprimediet/composer:2.8-php8.4-alpine
aprimediet/composer:2.8-alpine
aprimediet/composer:alpine

View File

@ -0,0 +1,131 @@
name: Build and Push Alpine based Composer Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push composer on alpine based image
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push 2.2 on php5.6
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php5
build-args: |
COMPOSER_VERSION=2.2.25
PHP_VERSION=5.6
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.2.25-php5.6-alpine
git.winteraccess.id/${{ gitea.repository }}:2.2-php5.6-alpine
- name: Build and push 2.8 on php7.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php7
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php7.2-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php7.2-alpine
- name: Build and push 2.8 on php7.3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php7
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=7.3
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php7.3-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php7.3-alpine
- name: Build and push 2.8 on php7.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-php7
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=7.4
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php7.4-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php7.4-alpine
- name: Build and push 2.8 on php8.0
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.0
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.0-php8.0-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php8.0-alpine
- name: Build and push 2.8 on php8.1
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.1
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php8.1-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php8.1-alpine
- name: Build and push 2.8 on php8.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php8.2-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php8.2-alpine
- name: Build and push 2.8 on php8.3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.3
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php8.3-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php8.3-alpine
- name: Build and push 2.8 on php8.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
COMPOSER_VERSION=2.8.4
PHP_VERSION=8.4
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.8.4-php8.4-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-php8.4-alpine
git.winteraccess.id/${{ gitea.repository }}:2.8-alpine
git.winteraccess.id/${{ gitea.repository }}:alpine

View File

@ -1,119 +0,0 @@
name: Build and Push alpine Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: aprimediet
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push 2.2.23@php5.6
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=5.6
COMPOSER_VERSION=2.2.23
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.2.23-alpine-php5.6
aprimediet/composer:2.2.23-alpine-php5.6
- name: Build and push 2.2.23@php7.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=7.4
COMPOSER_VERSION=2.2.23
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.2.23
git.winteraccess.id/${{ gitea.repository }}:2.2.23-alpine
git.winteraccess.id/${{ gitea.repository }}:2.2.23-alpine-php7.4
aprimediet/composer:2.2.23
aprimediet/composer:2.2.23-alpine
aprimediet/composer:2.2.23-alpine-php7.4
- name: Build and push 2.7.2@php7.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=7.4
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine-php7.4
aprimediet/composer:2.7.2-alpine-php7.4
- name: Build and push 2.7.2@php8.0
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.0
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine-php8.0
aprimediet/composer:2.7.2-alpine-php8.0
- name: Build and push 2.7.2@php8.1
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.1
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine-php8.1
aprimediet/composer:2.7.2-alpine-php8.1
- name: Build and push 2.7.2@php8.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.2
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine-php8.2
aprimediet/composer:2.7.2-alpine-php8.2
- name: Build and push 2.7.2@php8.3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.3
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine
git.winteraccess.id/${{ gitea.repository }}:2.7.2-alpine-php8.3
git.winteraccess.id/${{ gitea.repository }}:latest-alpine
aprimediet/composer:2.7.2-alpine
aprimediet/composer:2.7.2-alpine-php8.3
aprimediet/composer:latest-alpine

View File

@ -1,135 +0,0 @@
name: Build and Push Ubuntu Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: aprimediet
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push 2.2.23@php5.6
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=5.6
COMPOSER_VERSION=2.2.23
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.2.23-ubuntu-php5.6
aprimediet/composer:2.2.23-ubuntu-php5.6
- name: Build and push 2.2.23@php7.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=7.2
COMPOSER_VERSION=2.2.23
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.2.23-ubuntu-php7.2
aprimediet/composer:2.2.23-ubuntu-php7.2
- name: Build and push 2.2.23@php7.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=7.4
COMPOSER_VERSION=2.2.23
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.2.23
git.winteraccess.id/${{ gitea.repository }}:2.2.23-ubuntu
git.winteraccess.id/${{ gitea.repository }}:2.2.23-ubuntu-php7.4
aprimediet/composer:2.2.23
aprimediet/composer:2.2.23-ubuntu
aprimediet/composer:2.2.23-ubuntu-php7.4
- name: Build and push 2.7.2@php7.4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.2
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-ubuntu-php7.4
aprimediet/composer:2.7.2-ubuntu-php7.4
- name: Build and push 2.7.2@php8.0
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.0
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-ubuntu-php8.0
aprimediet/composer:2.7.2-ubuntu-php8.0
- name: Build and push 2.7.2@php8.1
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.1
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-ubuntu-php8.1
aprimediet/composer:2.7.2-ubuntu-php8.1
- name: Build and push 2.7.2@php8.2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.2
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2-ubuntu-php8.2
aprimediet/composer:2.7.2-ubuntu-php8.2
- name: Build and push 2.7.2@php8.3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.3
COMPOSER_VERSION=2.7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:2.7.2
git.winteraccess.id/${{ gitea.repository }}:2.7.2-ubuntu
git.winteraccess.id/${{ gitea.repository }}:2.7.2-ubuntu-php8.3
git.winteraccess.id/${{ gitea.repository }}:latest-ubuntu
git.winteraccess.id/${{ gitea.repository }}:latest
aprimediet/composer:2.7.2
aprimediet/composer:2.7.2-ubuntu
aprimediet/composer:2.7.2-ubuntu-php8.3
aprimediet/composer:latest-ubuntu
aprimediet/composer:latest

View File

@ -1,64 +1,107 @@
ARG PHP_VERSION=8.3
ARG REGISTRY_URL=git.winteraccess.id/docker
ARG PHP_VERSION=8.4
ARG REGISTRY_URL=docker.io/aprimediet
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ARG COMPOSER_VERSION=2.7.2
ARG COMPOSER_VERSION=2.8.4
USER root
WORKDIR /tmp
USER root
# Set composer home
ENV COMPOSER_HOME=/usr/local/share/composer
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
# Setup composer user
RUN addgroup -g 10001 composer && \
adduser -D -u 10001 -G composer -s /bin/sh -h /build composer
# CREATE CACHES DIR FOR COMPOSER
RUN mkdir -p ${COMPOSER_CACHE_DIR}/files && \
mkdir -p ${COMPOSER_CACHE_DIR}/repo && \
mkdir -p ${COMPOSER_CACHE_DIR}/vcs && \
chown -R composer:composer ${COMPOSER_CACHE_DIR}
# ADD apk repository
RUN printf "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing\n" >> /etc/apk/repositories
# Update & Upgrade first
RUN --mount=type=cache,target=/var/cache/apk \
apk update && apk upgrade && apk add git
apk update && apk upgrade && apk add git \
php${PHP_VERSION}-bcmath php${PHP_VERSION}-bz2 \
php${PHP_VERSION}-calendar php${PHP_VERSION}-cgi php${PHP_VERSION}-common \
php${PHP_VERSION}-ctype php${PHP_VERSION}-curl php${PHP_VERSION}-dba \
php${PHP_VERSION}-dev php${PHP_VERSION}-dom \
php${PHP_VERSION}-embed php${PHP_VERSION}-enchant php${PHP_VERSION}-exif \
php${PHP_VERSION}-ffi php${PHP_VERSION}-fileinfo php${PHP_VERSION}-ftp \
php${PHP_VERSION}-gd php${PHP_VERSION}-gettext php${PHP_VERSION}-gmp \
php${PHP_VERSION}-intl php${PHP_VERSION}-ldap php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysqli php${PHP_VERSION}-mysqlnd php${PHP_VERSION}-odbc \
php${PHP_VERSION}-opcache php${PHP_VERSION}-pcntl php${PHP_VERSION}-pdo \
php${PHP_VERSION}-pdo_dblib php${PHP_VERSION}-pdo_mysql php${PHP_VERSION}-pdo_odbc \
php${PHP_VERSION}-pdo_pgsql php${PHP_VERSION}-pdo_sqlite php${PHP_VERSION}-pear \
php${PHP_VERSION}-pgsql php${PHP_VERSION}-posix php${PHP_VERSION}-session \
php${PHP_VERSION}-shmop php${PHP_VERSION}-simplexml php${PHP_VERSION}-snmp \
php${PHP_VERSION}-soap php${PHP_VERSION}-sockets php${PHP_VERSION}-sodium \
php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-sysvmsg php${PHP_VERSION}-sysvsem \
php${PHP_VERSION}-sysvshm php${PHP_VERSION}-tidy php${PHP_VERSION}-tokenizer \
php${PHP_VERSION}-xml php${PHP_VERSION}-xmlreader php${PHP_VERSION}-xmlwriter \
php${PHP_VERSION}-xsl php${PHP_VERSION}-zip
# INSTALL PHP OpenSSL
# Install php-dbg
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-dbg; exit 0
# Install php-openssl from testing if main or community doesn't exists
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-dbg@testing; exit 0
# Install php-openSSL
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-openssl; exit 0
# Install php83-openssl from testing if main or community doesn't exists
# Install php-openssl from testing if main or community doesn't exists
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-openssl@testing; exit 0
# INSTALL PHP PHAR
# Install php-phar
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-phar; exit 0
# Install php83-phar from testing if main or community doesn't exists
# Install php-phar from testing if main or community doesn't exists
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-phar@testing; exit 0
# Install php83-json
# Install php-json
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-json; exit 0
# Install php83-json from testing if main or community doesn't exists
# Install php-json from testing if main or community doesn't exists
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-json@testing; exit 0
# Install php83-iconv
# Install php-iconv
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-iconv; exit 0
# Install php83-iconv from testing if main or community doesn't exists
# Install php-iconv from testing if main or community doesn't exists
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-iconv@testing; exit 0
# DOWNLOAD AND INSTALL COMPOSER
# Download and install composer
ADD https://getcomposer.org/installer ./composer-setup.php
RUN php composer-setup.php --version=${COMPOSER_VERSION} && mv composer.phar /usr/local/bin/composer && rm -f ./composer-setup.php
RUN php composer-setup.php --version=${COMPOSER_VERSION} && \
mv composer.phar /usr/local/bin/composer && \
rm -f ./composer-setup.php
# SET COMPOSER HOME
ENV COMPOSER_HOME /usr/local/share/composer
ENV COMPOSER_CACHE_DIR ${COMPOSER_HOME}/cache
# Clean apk caches
RUN rm -vrf /var/cache/apk/* && \
rm -rf /root/.composer; exit 0
# CREATE CACHES DIR FOR COMPOSER
RUN mkdir -p ${COMPOSER_CACHE_DIR}/{files,repo,vcs}
USER composer
# CLEAN APK CACHES
RUN rm -vrf /var/cache/apk/* && rm -rf /root/.composer; exit 0
WORKDIR /build
CMD ["/usr/local/bin/composer"]

88
Dockerfile.alpine-php5 Normal file
View File

@ -0,0 +1,88 @@
ARG PHP_VERSION=7.4
ARG REGISTRY_URL=docker.io/aprimediet
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ARG COMPOSER_VERSION=2.8.4
USER root
WORKDIR /tmp
# Set composer home
ENV COMPOSER_HOME=/usr/local/share/composer
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
# Setup composer user
RUN addgroup -g 10001 composer && \
adduser -D -u 10001 -G composer -s /bin/sh -h /build composer
# CREATE CACHES DIR FOR COMPOSER
RUN mkdir -p ${COMPOSER_CACHE_DIR}/files && \
mkdir -p ${COMPOSER_CACHE_DIR}/repo && \
mkdir -p ${COMPOSER_CACHE_DIR}/vcs && \
chown -R composer:composer ${COMPOSER_CACHE_DIR}
# Update & Upgrade first
RUN --mount=type=cache,target=/var/cache/apk \
apk update && apk upgrade && apk add git \
php${PHP_VERSION}-bcmath php${PHP_VERSION}-bz2 \
php${PHP_VERSION}-calendar php${PHP_VERSION}-cgi php${PHP_VERSION}-common \
php${PHP_VERSION}-ctype php${PHP_VERSION}-curl php${PHP_VERSION}-dba \
php${PHP_VERSION}-dev php${PHP_VERSION}-dom \
php${PHP_VERSION}-embed php${PHP_VERSION}-enchant php${PHP_VERSION}-exif \
php${PHP_VERSION}-ftp \
php${PHP_VERSION}-gd php${PHP_VERSION}-gettext php${PHP_VERSION}-gmp \
php${PHP_VERSION}-intl php${PHP_VERSION}-ldap \
php${PHP_VERSION}-mysqli php${PHP_VERSION}-odbc \
php${PHP_VERSION}-opcache php${PHP_VERSION}-pcntl php${PHP_VERSION}-pdo \
php${PHP_VERSION}-pdo_dblib php${PHP_VERSION}-pdo_mysql php${PHP_VERSION}-pdo_odbc \
php${PHP_VERSION}-pdo_pgsql php${PHP_VERSION}-pdo_sqlite php${PHP_VERSION}-pear \
php${PHP_VERSION}-pgsql php${PHP_VERSION}-posix \
php${PHP_VERSION}-shmop php${PHP_VERSION}-snmp \
php${PHP_VERSION}-soap php${PHP_VERSION}-sockets \
php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-sysvmsg php${PHP_VERSION}-sysvsem \
php${PHP_VERSION}-sysvshm \
php${PHP_VERSION}-xml php${PHP_VERSION}-xmlreader \
php${PHP_VERSION}-xsl php${PHP_VERSION}-zip
# Install php-dbg
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-dbg; exit 0
# Install php-ffi
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-ffi; exit 0
# Install php-openSSL
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-openssl; exit 0
# Install php-phar
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-phar; exit 0
# Install php-json
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-json; exit 0
# Install php-iconv
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-iconv; exit 0
# Download and install composer
ADD https://getcomposer.org/installer ./composer-setup.php
RUN php composer-setup.php --version=${COMPOSER_VERSION} && \
mv composer.phar /usr/local/bin/composer && \
rm -f ./composer-setup.php
# Clean apk caches
RUN rm -vrf /var/cache/apk/* && \
rm -rf /root/.composer; exit 0
USER composer
WORKDIR /build
CMD ["/usr/local/bin/composer"]

88
Dockerfile.alpine-php7 Normal file
View File

@ -0,0 +1,88 @@
ARG PHP_VERSION=7.4
ARG REGISTRY_URL=docker.io/aprimediet
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ARG COMPOSER_VERSION=2.8.4
USER root
WORKDIR /tmp
# Set composer home
ENV COMPOSER_HOME=/usr/local/share/composer
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
# Setup composer user
RUN addgroup -g 10001 composer && \
adduser -D -u 10001 -G composer -s /bin/sh -h /build composer
# CREATE CACHES DIR FOR COMPOSER
RUN mkdir -p ${COMPOSER_CACHE_DIR}/files && \
mkdir -p ${COMPOSER_CACHE_DIR}/repo && \
mkdir -p ${COMPOSER_CACHE_DIR}/vcs && \
chown -R composer:composer ${COMPOSER_CACHE_DIR}
# Update & Upgrade first
RUN --mount=type=cache,target=/var/cache/apk \
apk update && apk upgrade && apk add git \
php${PHP_VERSION}-bcmath php${PHP_VERSION}-bz2 \
php${PHP_VERSION}-calendar php${PHP_VERSION}-cgi php${PHP_VERSION}-common \
php${PHP_VERSION}-ctype php${PHP_VERSION}-curl php${PHP_VERSION}-dba \
php${PHP_VERSION}-dev php${PHP_VERSION}-dom \
php${PHP_VERSION}-embed php${PHP_VERSION}-enchant php${PHP_VERSION}-exif \
php${PHP_VERSION}-fileinfo php${PHP_VERSION}-ftp \
php${PHP_VERSION}-gd php${PHP_VERSION}-gettext php${PHP_VERSION}-gmp \
php${PHP_VERSION}-intl php${PHP_VERSION}-ldap php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysqli php${PHP_VERSION}-mysqlnd php${PHP_VERSION}-odbc \
php${PHP_VERSION}-opcache php${PHP_VERSION}-pcntl php${PHP_VERSION}-pdo \
php${PHP_VERSION}-pdo_dblib php${PHP_VERSION}-pdo_mysql php${PHP_VERSION}-pdo_odbc \
php${PHP_VERSION}-pdo_pgsql php${PHP_VERSION}-pdo_sqlite php${PHP_VERSION}-pear \
php${PHP_VERSION}-pgsql php${PHP_VERSION}-posix php${PHP_VERSION}-session \
php${PHP_VERSION}-shmop php${PHP_VERSION}-simplexml php${PHP_VERSION}-snmp \
php${PHP_VERSION}-soap php${PHP_VERSION}-sockets php${PHP_VERSION}-sodium \
php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-sysvmsg php${PHP_VERSION}-sysvsem \
php${PHP_VERSION}-sysvshm php${PHP_VERSION}-tidy php${PHP_VERSION}-tokenizer \
php${PHP_VERSION}-xml php${PHP_VERSION}-xmlreader php${PHP_VERSION}-xmlwriter \
php${PHP_VERSION}-xsl php${PHP_VERSION}-zip
# Install php-dbg
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-dbg; exit 0
# Install php-ffi
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-ffi; exit 0
# Install php-openSSL
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-openssl; exit 0
# Install php-phar
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-phar; exit 0
# Install php-json
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-json; exit 0
# Install php-iconv
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update php${PHP_VERSION}-iconv; exit 0
# Download and install composer
ADD https://getcomposer.org/installer ./composer-setup.php
RUN php composer-setup.php --version=${COMPOSER_VERSION} && \
mv composer.phar /usr/local/bin/composer && \
rm -f ./composer-setup.php
# Clean apk caches
RUN rm -vrf /var/cache/apk/* && \
rm -rf /root/.composer; exit 0
USER composer
WORKDIR /build
CMD ["/usr/local/bin/composer"]

View File

@ -10,10 +10,34 @@ WORKDIR /tmp
USER root
# INSTALL GIT
# INSTALL GIT And Required PHP Extensions
RUN --mount=type=cache,target=/var/cache/apt/archives \
apt -y update && apt -y upgrade && apt -y install \
git
git php${PHP_VERSION}-bcmath php${PHP_VERSION}-bz2 \
php${PHP_VERSION}-cgi php${PHP_VERSION}-curl \
php${PHP_VERSION}-dba php${PHP_VERSION}-dev \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-gnupg php${PHP_VERSION}-grpc \
php${PHP_VERSION}-http php${PHP_VERSION}-imagick \
php${PHP_VERSION}-imap php${PHP_VERSION}-intl \
php${PHP_VERSION}-json php${PHP_VERSION}-ldap \
php${PHP_VERSION}-libvirt-php php${PHP_VERSION}-lz4 \
php${PHP_VERSION}-mbstring php${PHP_VERSION}-mcrypt \
php${PHP_VERSION}-memcache php${PHP_VERSION}-memcached \
php${PHP_VERSION}-mongodb php${PHP_VERSION}-mysql \
php${PHP_VERSION}-oauth php${PHP_VERSION}-odbc \
php${PHP_VERSION}-opcache php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-pq php${PHP_VERSION}-pspell \
php${PHP_VERSION}-radius php${PHP_VERSION}-rdkafka \
php${PHP_VERSION}-redis php${PHP_VERSION}-rrd \
php${PHP_VERSION}-snmp php${PHP_VERSION}-soap \
php${PHP_VERSION}-solr php${PHP_VERSION}-sqlite3 \
php${PHP_VERSION}-ssh2 php${PHP_VERSION}-swoole \
php${PHP_VERSION}-tidy php${PHP_VERSION}-uuid \
php${PHP_VERSION}-xdebug php${PHP_VERSION}-xml \
php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-xsl \
php${PHP_VERSION}-yaml php${PHP_VERSION}-zip \
php${PHP_VERSION}-zstd
# DOWNLOAD AND INSTALL COMPOSER
ADD https://getcomposer.org/installer ./composer-setup.php
@ -24,4 +48,4 @@ ENV COMPOSER_HOME /usr/local/share/composer
ENV COMPOSER_CACHE_DIR ${COMPOSER_HOME}/cache
# CREATE CACHES DIR FOR COMPOSER
RUN mkdir -p ${COMPOSER_CACHE_DIR}/{files,repo,vcs}
RUN mkdir -p ${COMPOSER_CACHE_DIR}/{files,repo,vcs}