37 lines
1.2 KiB
Docker
37 lines
1.2 KiB
Docker
ARG PHP_VERSION=8.3
|
|
ARG REGISTRY_URL=git.winteraccess.id/docker
|
|
|
|
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine
|
|
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
|
|
|
|
ARG COMPOSER_VERSION=2.7.2
|
|
|
|
WORKDIR /tmp
|
|
|
|
USER root
|
|
|
|
# ADD apk repository
|
|
RUN printf "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing\n" >> /etc/apk/repositories
|
|
|
|
# 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
|
|
RUN --mount=type=cache,target=/var/cache/apk \
|
|
apk add --update php${PHP_VERSION}-phar@testing; exit 0
|
|
|
|
# Install php83-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
|
|
RUN --mount=type=cache,target=/var/cache/apk \
|
|
apk add --update php${PHP_VERSION}-json@testing; 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/* |